coupe-r Posted December 29, 2011 Share Posted December 29, 2011 Hi All, I would like to have my submit button disabled on click, so the button cannot be pressed over and over again. I try using: onclick="this.disabled=true;return true;" But then nothing posts... Any ideas? If it isn't too much trouble, how would I change the value of the button to "processing..." AND disabled onClick? Thanks Quote Link to comment Share on other sites More sharing options...
scootstah Posted December 29, 2011 Share Posted December 29, 2011 Use a function in the onSubmit event in the form element to disable the submit button. Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted December 29, 2011 Share Posted December 29, 2011 what I would do is check for the form submission and then proceed to disable the submit button. I also recommend jquery for this. A simple solution could be, document.getElementById("form_id").onSubmit = function() { document.getElementById("submit_id").disabled; }; of course there is room to expand upon this, but this will do the trick. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.