New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/Conditional Form #422
Conversation
add support for radio button; add new validation for number isEqual[number]
…ture/Conditoinal-Form # Conflicts: # demos/jscondform.php
Codecov Report
@@ Coverage Diff @@
## develop #422 +/- ##
=============================================
+ Coverage 67.83% 68.48% +0.64%
- Complexity 1422 1428 +6
=============================================
Files 76 77 +1
Lines 3355 3376 +21
=============================================
+ Hits 2276 2312 +36
+ Misses 1079 1064 -15
Continue to review full report at Codecov.
|
can hide or show an entire form group base on a field in that group.
EnhancementAdd ability to show or hide an entire group of fields by using a group selector.
Show group where 'php' belong if dev is checked and show group where 'other' belong if dev is checked. |
probably needs a demo too. |
there is an example of group hiding in demos/jscondform.php at the very
end, i.e. last form.
…On Fri, Mar 30, 2018 at 8:01 AM, Romans Malinovskis < ***@***.***> wrote:
probably needs a demo too.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#422 (comment)>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ACGjPt1SgcUuMHk_g9efUj4lIt_q-QL7ks5tjh6LgaJpZM4S_c_j>
.
--
Alain Belair
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks great. Reviewed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However - documentation is lacking (.rst). I'll try to add it myself.
Additional problems:
|
Conditional Form
Show or hide input field base on other input field condition.
Support all semantic-ui form validation rule.
Note on rule. FormService also add two more rule to semantic-ui existing ones:
notEmpty and isVisible.
fieldRules is an array that contains items where each item describe the field to hide or show
that depends on other field with their input value conditions.
Example
Can be phrase this way: Display 'fieldToShow' if 'field1' is not empty AND field2 is a number.
Support for OR condition
Adding and array of field => rules for the same field will OR the condition for that field.
Can be phrase this way: Display 'hair_cut' if 'race' contains 'poodle' AND 'age' is between 0 and 5 OR 'race' contains the exact word 'bichon'.
Support AND condition on same field.
Adding an array of conditions for the same field is also support.
Can be phrase this way: Display 'ext' if phone is a number AND phone has at least 7 char.
See semantic-ui validation rule for more details: https://semantic-ui.com/behaviors/form.html#validation-rules
Demos available using /demos/jscondform.php
Note
atkjs-ui.js need to be rebuild.