I've extended the register form with some AJAX functionality and added a custom validator method decribed here. Now I want to execute the validation process after getting the result of the AJAX call.
How can I do that?
I've extended the register form with some AJAX functionality and added a custom validator method decribed here. Now I want to execute the validation process after getting the result of the AJAX call.
How can I do that?
if You're trying to validate the form, follow the @Mage2.PRO answer. But as you mentioned in your comment that you're using a source to validate one field using ajax, then, you can use $.validator.validateElement($("#yourElement"));
this'll show the error message as it'd when submitting a form.
hope it helps.
The forms are automatically validated before its submission.
You can also run a form validation manually.
You should load the mage/validation
library and then call $(form).validation()
.
Validation.validate($(FIELD_NAME))