How to use jQuery.validate to enable submit button?
I have seen a few site showing that the validate plugin can be used to toggle the submit button on a form I have tried a few example but cant get it working this is my code below I have it placed within the ready function just after my validate rules etc
- $('#form input').bind('keyup blur click', function () { // fires on every keyup & blur
- if ($('#form').validate().checkForm()) { // checks form for validity
- $('#submit').removeClass('button_disabled').attr('disabled', false); // enables button
- } else {
- $('#submit').addClass('button_disabled').attr('disabled', true); // disables button
- }
- });
This is my buttons code
- <button id="submit" disabled="false" type="submit">Submit</button>
Can anyone point me in the right direction please?