colinaut / alpinejs-plugin-simple-validate

Simple Alpine form validation plugin
97 stars 4 forks source link

Do not validate hidden fields or fields #25

Closed leftfield74 closed 5 months ago

leftfield74 commented 5 months ago

This is more of an enhancement request rather than a bug and apologies if this is documented. I've poked around for a good amount of time but can't find resolutions to either of these.

Is there a way to disable validation of hidden fields, preferably using config? Just doesn't feel right to be validating these fields and adding the resultant error-msg spans (and other markup).

Also, is there a way to avoid validating some fields in a form intentionally? Got some labels/checkboxes where the added <span class="error-msg"></span> is throwing off the layout. Again, it doesn't feel right to add a additional CSS/style these fields to accommodate a span that is never going to appear.

One final question, can the console logging be disabled?

colinaut commented 5 months ago

Ah "type=hidden" shouldn't have error messages. That was an error introduced. Making it not add error messages for fields that don't need it is a good call too. Also yeah I left the logs in accidentally.

All changes are made in that latest release 1.8.2

leftfield74 commented 5 months ago

Upgraded and all checks out. Thanks for the quick turn around!