aerni / statamic-livewire-forms

Supercharge your Statamic forms with Livewire
https://statamic.com/addons/aerni/livewire-forms
Other
28 stars 2 forks source link

Conditional Field Still Being Validated #25

Closed godismyjudge95 closed 1 year ago

godismyjudge95 commented 1 year ago

When a field is hidden via conditional logic the validation logic appears to still be parsed for it and you cannot submit the form.

I would attempt to submit a pull request for this myself, but I am not sure how to filter the fields based on conditional logic before evaluating the validation rules.

aerni commented 1 year ago

That's the intended behavior. You don't want conditional logic to mess with validation rules. This is the same way it also works in the Statamic CP. You can add the sometimes rule if you want to submit a form, even when a required field is hidden: https://statamic.dev/conditional-fields#validation