Heres what im trying to do. After the form is submitted, i want to disable the submit button until any form element is changed. I already got it almost working using a different question on stackoverflow:
$('#myform').find (':submit').attr ('disabled', 'disabled');
// Re-enable submit
var form = $('#myform');
$(':input', form.get(0)).live ('change', function (e) {
form.find (':submit').removeAttr ('disabled');
});
One problem is that the if the button is disabled, and the user clicks the button, that counds as a change and its now enabled. So a simple double click of the button re-submits! Any suggestions?
[type!="submit"]
http://api.jquery.com/attribute-not-equal-selector/
$(':input[type!="submit"]', form.get(0)).live ('change', function (e) {
form.find (':submit').removeAttr ('disabled');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With