Last Updated: 25 Apr 2024 13:12 by Ross
Created on: 24 Apr 2024 10:21
Category: Form
Type: Feature Request
Add a method to reset the validation in the Form
Add a Form method to reset the validation on the fields, similar to the Validator reset method.
1 comment
Posted on: 25 Apr 2024 13:12

Original ticket (Ticket ID: 1646779 ), pointed to an error in the validator.reset() code and gave suggestions of a 5 to 7 line fix which would address the issue.  If that was fixed, this feature would not be necessary.

The root cause of the problem is the validator.validateInput function will raise the validateInput event to let any listeners know that the state has change from valid to invalid or vice versa but the validator.reset() does not.

When an input changes state, the validatInput method is invoked, if the control becomes invalid (or valid), the validateInput event is raised, and in the case of the default pop-up form, it listens for the event and toggles the labels from black to red or vice versa.

When the validator.reset() executes the invalid controls are reset so that the next time validateInput() is executed the code will raise the validateInput event if the control is still invalid.

However as the validator.reset code does not raise the validateInput event, any listeners don't learn that the input control has changed state and does not update its UI.