In v4.2.6, I made several changes to the validator's work:
By default, all validating functions work in required mode - field value cannot be empty and must have required value. You can change this behavior with special form attribute data-required-mode. If you set this attribute to false, functions will work only if field value not empty or with required function in the pair.
I also add a few helper methods and behavior when resetting the form.
+ [x] Validator: add func `reset` for reset fields state
+ [x] Validator: add func `reset_state` for reset field state
+ [x] Validator: add func `set_valid_state` for valid field state
+ [x] Validator: add func `set_invalid_state` for invalid field state
+ [x] Validator: add auto method `reset` for forms with role `validator`
+ [x] Validator: add option boolean `requiredMode` for form. If this option is `true`, all funcs works as `required`, else funcs works if field value is not empty.
Read me first before posting anywhere!
1 post • Page 1 of 1