views:

628

answers:

2

I am using jQuery validation on my form and I would like to be able to disable the submit button and change its class, when the form validates. I know I could bind a function on the key up event but I want to know if this is possible from within the jQuery validate framework. I tried doing what this guy suggested, but got nowhere.

I am using jQuery Validate

+3  A: 

It appears that you may be able to get this to work automatically within the options on the Validate plugin itself.

Check out this link on the jQuery docs for more information.

$("myForm").validate(
   {
       onkeyup: true, 
       onsubmit: false, 
       onclick: true, 
       onfocusout: true
   }
);
RSolberg
A: 

I am trying this but the onsubmit: false, makes the validation rules be ignored. Disabling the submit button should only happen when the form is valid and user has submitted. this to hinder double posts. How do i do this? (i find nothing about this in the documentation).

Mikelangelo
you should post your own question and reference this one to get answers.
Russ Bradberry