File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -22,3 +22,15 @@ The conditional wrapper supports the following attributes:
2222- ` 'hide-fields' ` - Whether the fields should also be hidden when they are disabled. Default is ` false ` .
2323- ` 'disable' ` - Setting this to ` true ` will invert the behaviour. i.e The section will get disabled if the given value is selected.
2424- ` 'json-encode' ` - Whether to json encode the given value. Default is ` true ` if the given value is an array, otherwise it's false.
25+
26+
27+ ## Disabling an input field depending on a checkbox status
28+ Sometimes, you may want to disable a if a checkbox is checked. This can be done using the ` data-toggle-checkbox ` attribute.
29+ This attribute should be set to the selector of the input field you want to disable.
30+
31+ In this example, we will disable the ` max_salary ` input field if the ` any_max_salary ` checkbox is checked.
32+
33+ ``` html
34+ <x-forms::number name =" max_salary" label =" Max Salary" />
35+
36+ <x-forms::checkbox name =" any_max_salary" :value =" 1" data-toggle-checkbox =" #max-salary" />
You can’t perform that action at this time.
0 commit comments