Releases: ajaishankar/stimulus-zod-form
Releases · ajaishankar/stimulus-zod-form
Simplified field validation
Simplified field validation
data-action="blur->field#validate"
// vs
data-action="blur->field#setTouched blur->form#validate"
Support fields outside of form
<form data-controller="form"
id="my-form"
data-form-field-outlet=".form-field"
data-action="form#submit">
</form>
<div data-controller="field" class="form-field">
<input name="addresses[0].city"
form="my-form" <!-- associate input with form -->
data-field-target="input"
data-action="blur->field#validate" />
<div data-field-target="error"></div>
</div>