Ok, that makes sense mostly, but I've tried several things now and had no success, so perhaps I'm not really getting it.
First I tried adding form.submit() after I set form.submittable(true), but that throws me into an infinite loop. I've read through the API Reference guide several times now and I don't see a way to force the form to submit without causing this loop since I'm using the onValidate method which is always called on a submit.
I also tried matching my code to the Custom Error Message example here:
https://developers.marketo.com/rest-api/assets/forms/examples/ (at the bottom)
And still no luck. I'm not sure why this code works but mine doesn't. The only difference I see is that I'm setting the if/else statement within a get call. I thought the difference was that it wasn't recognizing the form.submittable(true), but you said it is seeing that, so it must be something else here that's not letting it submit as in the example above.
My only other idea right now is to try triggering my validation onClick using .validate() prior to the onClick (submit) call. I'm not so sure that would work though.
Any suggestions on the route I should pursue? Thank you again for your help.
You're close, but still not quite seeing the big picture.
When the validation succeeds, you need to set a variable (in the closure) and then call submit(). That submit() will call your onValidate listener again, but you check for that variable to see if the extended validation has already passed. No infinite loop.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.