'Wait pending requests before finalize submit on Javascript
I have the following situation on a web application (javascript-jQuery):
- A form using validator of https://jquerytools.org/
- In the form there is a [required] masked input (bank account) from https://github.com/RobinHerbots/Inputmask, which throws a request on server on change event and during the request the input is disabled to avoid modifications.
When the form is submitted, sometimes, when the bank account is empty, the validation "required" is not checked. After a crazy debug, I've seen that the input mask control, is firing a change event, and so, the request is throwed to the server (so the input is disabled), and the validator doesn't validates the required, because it has a condition that the disabled fields are not validated.
I would to "pause" the validation until all requests are finished, but I haven't found the way to do it outside the library. Any idea of how to solve this problem wihtout modifying the external libs ("jquery inputmask" and "jquery tools")?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
