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 Link to comment https://forums.phpfreaks.com/topic/254020-onclick-disable-submit-button-help/ 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. Link to comment https://forums.phpfreaks.com/topic/254020-onclick-disable-submit-button-help/#findComment-1302247 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. Link to comment https://forums.phpfreaks.com/topic/254020-onclick-disable-submit-button-help/#findComment-1302254 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.