You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue: For some reason this library does not perform validation correctly whenever classes are added to the form input elements.
Update: I have found out that if there are any exceptions thrown from within the custom callback function, the form will submit and bypass the validation!
Further issue:
Scenario:
I have setup validation options with the second argument, the callback function.
What makes this very difficult to solve is that the validator ignores the exception, does not report to console.log and continues to redirect the user to the next page. 👎
What I suggest to improve this, and help people avoid this issue:
In the example documentation, update to something like this:
// Validation Configuration
var validator = new FormValidator('myFormId', [
// ...
// validation settings
// ...
], function (errors, event) {
try {
// Custom code goes here
} catch (ex) {
// This is displayed if any major errors occur in the custom code
console.error('** ERROR IN FORM VALIDATION CALLBACK FUNCTION **');
console.error(ex);
}
});
The text was updated successfully, but these errors were encountered:
christoferd
changed the title
Form allows submit on error within custom callback
Form validation is bypassed if any exceptions within custom callback
Mar 18, 2019
Form submits with errors after a validation.
Issue: For some reason this library does not perform validation correctly whenever classes are added to the form input elements.
Update: I have found out that if there are any exceptions thrown from within the custom callback function, the form will submit and bypass the validation!
Further issue:
Scenario:
I have setup validation options with the second argument, the callback function.
What makes this very difficult to solve is that the validator ignores the exception, does not report to console.log and continues to redirect the user to the next page. 👎
What I suggest to improve this, and help people avoid this issue:
In the example documentation, update to something like this:
The text was updated successfully, but these errors were encountered: