4

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

1
  • Just updated my post.... Commented Sep 16, 2009 at 22:24

1 Answer 1

4

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
   }
);
Sign up to request clarification or add additional context in comments.

3 Comments

As per the documents you referenced, "a boolean true is not a valid value" for any of these listed options. You can only set them to false or over-ride them with a custom function. However, these are already the default behaviors so setting any of them to true is not only unnecessary, it could potentially break this plugin.
@Sparky - This question is 4 years old. Documents change! Rather than vote down an answer, you ought to edit it. make it right.
I will not edit an answer if it makes "the code do something different than what the answer says it does" or like here, I'd have to rewrite the entire answer. However, I did let you know exactly what this issue is so you'd have every opportunity to fix it yourself. Once fixed, I'll always reconsider retracting any down-vote I may have cast, and even up-vote if/when appropriate. In this case, even four years ago, these options were documented and functioned the same as today.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.