Releases: colinaut/alpinejs-plugin-simple-validate
Release 1.8.2
Plugin now only adds error messages to fields that need it. It skips "type=hidden" inputs and any fields that are not required or have a pattern. Fields with Alpine binding ":required" ":pattern" or "x-validate" are assumed to require error handling.
Commits
Release 1.8.1
Removed adding error msg for type=hidden inputs
Release 1.8.0
- Works with nested fieldsets for $validate magic functions like isComplete(), data(), or value().
- Disabled is now a field property of the formData object. When a field is disabled, either by setting disabled on the field itself or a parent fieldset, the disabled property is set to true. Disabled fields are valid by default and return no value. Disabled is watched for by a mutation observer so AlpineJS binding of
:disabled
will work. - Hidden attributes no longer require x-validate in order to update when set with
:value
or other javascript that dynamically updates the value. The mutation observer automatically spots the change and updates. - BREAKING CHANGE x-required is removed. Use AlpineJS binding
:required
instead to set required dynamically.
Fix for checkbox groups error msg
Fix for issue with checkbox group error message introduced in recent other fixes.
Release 1.7.27 — FIX for id based error messages
1.7.25 broke the use of making custom error messages using ids. This release fixes that.
Breaking Change: If you use the id approach for custom error messages it now uses the id of the field and not the name. So the id is as follows: error-msg-${id-of-matching-field}
. This change is required for multiple forms where they may have the same named fields, whereas id tags will always be unique.
Note that when these error messages are autogenerated, the code also uses the id of the field. If the field does not have an id it creates a unique one randomly which is used to match to the error message.
Release 1.7.25 Fix for multiform
Commit:
- fix(multiform): add id for forms missing ids and used for unique id for error messages (fa221ee)
This fixes issues with error messages ids where two forms have the same named field. Error messages now have unique ids based on the form ID and id or name of the field. If the form does not have an ID it is assigned a randomized one when the script initializes.
Release 1.7.24 Fix for multi-forms and error messages
Release 1.7.23
- fix: for submit issue with hitting return (45bcb5d)
Release 1.7.22
- feat: added validate-on-submit option (f77cafa)