updated README.md with dependant field information
This commit is contained in:
22
README.md
22
README.md
@ -413,6 +413,7 @@ or [`input`](https://developer.mozilla.org/en-US/docs/Web/API/Element/input_even
|
|||||||
|
|
||||||
## Field Options
|
## Field Options
|
||||||
|
|
||||||
|
* [dependant](#dependant)
|
||||||
* [maxCount](#maxcount)
|
* [maxCount](#maxcount)
|
||||||
* [minCount](#mincount)
|
* [minCount](#mincount)
|
||||||
* [optional](#optional)
|
* [optional](#optional)
|
||||||
@ -435,6 +436,27 @@ properly formatted JSON object with the properties and values below.
|
|||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### dependant
|
||||||
|
|
||||||
|
**Default:** `null`
|
||||||
|
|
||||||
|
Setting the `dependant` value of one field to another field's `name` attribute
|
||||||
|
value will disable the field when its dependant does not contain a value.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<figure class="form-group">
|
||||||
|
<label for="dependant-parent">Dependant Parent</label>
|
||||||
|
<input id="dependant-parent" type="text" name="dependant_parent">
|
||||||
|
<figcaption>This field dynamically enables/disables the 'Dependant Child' field if it has a value.</figcaption>
|
||||||
|
</figure>
|
||||||
|
|
||||||
|
<figure class="form-group">
|
||||||
|
<label for="dependant-child">Dependant Child</label>
|
||||||
|
<input data-validation='{"dependant": "dependant_parent"}' id="dependant-child" type="text" name="dependant_child">
|
||||||
|
<figcaption>This field dynamically enables/disables if the 'Dependant Parent' field has a value.</figcaption>
|
||||||
|
</figure>
|
||||||
|
```
|
||||||
|
|
||||||
### maxCount (Checkboxes Only)
|
### maxCount (Checkboxes Only)
|
||||||
|
|
||||||
**Default:** `null`
|
**Default:** `null`
|
||||||
|
Reference in New Issue
Block a user