Hi,
This might be a mistake in my code but i'm not sure how to solve it. I have a form which sends ajax request on submit and if for example email is already used, it returns an error. Now, i tried to use pause/resume to prevent sending multiple requests, however when i pause, and then resume, submitting again will not work the first time, only the second time.
This might be a mistake in my code but i'm not sure how to solve it. I have a form which sends ajax request on submit and if for example email is already used, it returns an error. Now, i tried to use pause/resume to prevent sending multiple requests, however when i pause, and then resume, submitting again will not work the first time, only the second time.
- 'form.register submit': function(element, event) {
- event.pause();
- var user = new Model.User(can.deparam(form.serialize()));
- user.save(
- function(response) {
- //irrelevant
- },
- function(error) {
- //show error, etc
- event.resume();
- }
- );
- }