Using jquery.validate.js. Having a minor technical problem for my reset password form.
Validation working well. Got rules + messages before submitHandler.
Every messages goes directly to my
<span class="help-block" id="error"></span>
located below each input box. Thus I get live error messages below those boxes if I type anything wrong.
Problem: If I type everything correctly, no error messages will show up. And I get a success and new password. This is good.
But if I fail during typing, but afterwards correct it, and are successful making new password, I still get the "old" error in my above span help-block. Even if everything was a success.
So imagine I have this:
$("#form-reset").validate(
{
rules:
{
pass: { required: true}
},
messages:
{ pass: { required: dsaj jfaio daijo djaio}
},
/*AND HERE THE HELP-BLOCK TO GIVE CLIENT INFO*/
{
},
/* here the submitHandler*/
submitHandler: submitFormReset
});
/* submitHandler kick off this function */
function submitFormReset()
{
/* At this point I would like to turn off validation*/
}
I tried to remove the class and id on the help blocks in the above function. It will remove the info text, but since the input box become red (if fail) and green (if success) I still get a problem with a red color even with a success. So I guess I need to 'turn off' validation at this point instead. If that is possible...