I’m creating a validation plugin that, in the client side, will need to run an ajax call and then call messages.push() in some error callbacks.
First I ran into the issue where the form was being submitted before the ajax call was completed, and I fixed that using async
in the call.
Now I’m having a problem where the form is submitted even thought the error callbacks are called - as if the submission and the error callbacks were running at the same time, and then yiiactiveform could not see on time the new error messages.
Is there a way to make yiiactiveform wait until I say it’s ok to go ahead (like if I could say yiiactiveform.wait() in the beginning and yiiactiveform.done() inside the callbacks), or make those callbacks run smoothly in a synchronous fashion?