I have created a form validation plugin just like jQuery Validation Plugin
But I have no idea how to wait for remote validations like check for duplicate usernames
jQuery Validation Plugin:
var form = $('form');
form.validate();
if (form.valid()) {
//Do something if the form is valid
}
My Validation Plugin:
var form = $('form');
if (await form.valid()) {
//Do something if the form is valid
}
I don't like to use async and await operators and I would like to know how the jQuery Validation Plugin does this without using async and await operators
This is not because of not using await/async, it is because of how it is implemented
In fact, there is no other option