Disabling a form button after a click doesn't work?
I'm trying to disable the submit button of my form and set the value to "waiting.." after someone clicks. In my javascript I'm doing: $("#node-form .form-submit")[0].disabled=true However with that added, the form can never be submitted successfully --it throws you back to the form but without any visible errors. (I take it out and it works) Any suggestions?
I think you want something like $(document).ready( function(){ $("#node-form").submit( function() { $("#node-form .form-submit")[0].disabled=true; return true; } ); } ); I think if you do the disable on the click event you disable the submit event. This way it does the disable as part of the submit. Steve Ringwood Nevets Software
What about disabling the button on release instead of on click? That's when the action associated with a button is triggered in the browser. For example, if you click on the button but drag away from it, nothing happens.
participants (3)
-
Andy Triboletti -
Florian Loretan -
Steve Ringwood