uppdate README.md dependent field information

This commit is contained in:
2025-04-12 11:42:41 -04:00
parent e114c8a175
commit cb57869a94

View File

@ -413,7 +413,7 @@ or [`input`](https://developer.mozilla.org/en-US/docs/Web/API/Element/input_even
## Field Options
* [dependant](#dependant)
* [dependent](#dependent)
* [maxCount](#maxcount)
* [minCount](#mincount)
* [optional](#optional)
@ -436,24 +436,24 @@ properly formatted JSON object with the properties and values below.
</div>
```
### dependant
### dependent
**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.
Setting the `dependent` value of one field to another field's `name` attribute
value will disable the field when its dependent 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>
<label for="dependent-parent">Dependent Parent</label>
<input id="dependent-parent" type="text" name="dependent_parent">
<figcaption>This field dynamically enables/disables the 'Dependent 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>
<label for="dependent-child">Dependent Child</label>
<input data-validation='{"dependent": "dependent_parent"}' id="dependent-child" type="text" name="dependent_child">
<figcaption>This field dynamically enables/disables if the 'Dependent Parent' field has a value.</figcaption>
</figure>
```