@@ -24,23 +24,24 @@ Options are passed to fields using *input_html* parameter as *data* attributes.
2424
2525Conditions:
2626- ** data-if** : check a condition, values:
27- + ** checked** : check if a checkbox is checked
27+ + ** checked** : check if a checkbox is checked (ex. ` "data-if": "checked" ` )
2828 + ** not_checked** : check if a checkbox is not checked
2929 + ** blank** : check if a field is blank
3030 + ** not_blank** : check if a field is not blank
3131 + ** changed** : check if the value of an input is changed (dirty)
32- - ** data-eq** : check if a field has a specific value
33- - ** data-not** : check if a field hasn't a specific value
34- - ** data-function** : check the return value of a custom function
32+ - ** data-eq** : check if a field has a specific value (ex. ` "data-eq": "42" ` )
33+ - ** data-not** : check if a field has not a specific value
34+ - ** data-function** : check the return value of a custom function (ex. ` "data-function": "my_check" ` )
3535
3636Actions:
3737- ** data-then** : action to trigger (alias ** data-action** ), values:
38- + ** hide** : hides elements
38+ + ** hide** : hides elements (ex. ` "data-then": "hide", "data-target": ".errors" ` )
3939 + ** slide** : hides elements (using sliding)
4040 + ** fade** : hides elements (using fading)
41- + ** addClass** : adds classes
42- + ** setValue** : set a value
43- + ** callback** : call a function (with arguments: ** data-args** )
41+ + ** addClass** : adds classes (ex. ` "data-then": "addClass red" ` )
42+ + ** setText** : set the text of an element (ex. ` "data-then": "setText A sample text" ` )
43+ + ** setValue** : set the value of an input element (ex. ` "data-then": "setValue A sample value" ` )
44+ + ** callback** : call a function (with arguments: ** data-args** ) (ex. ` "data-then": "callback a_fun" ` )
4445- ** data-else** : action to trigger when the condition check is not true
4546- ** data-args** : arguments passed to the callback function
4647
0 commit comments