Validator in 4.2.6

Read me first before posting anywhere!
Post Reply
User avatar
Site Admin
Posts: 238
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Validator in 4.2.6

Post by olton » Thu May 10, 2018 11:06 am

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.

### 4.2.6
+ [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.

Post Reply