Reputation: 751
How to include the JS disable button ON SUBMIT in below my code :
$(document).ready(function(){
$('#haps').bind("blur focus keydown keypress keyup", function(){recount();});
$('input.button').attr('disabled','disabled');
$('#hapsForm').submit(function(e){
haps();
});
});
This I give the function to prevent double post. So have an idea ?
Thank you
Upvotes: 0
Views: 60
Reputation: 57312
you can dot this by
attr('disabled', 'disabled');
like
$('#hapsForm').submit(function(e){
$(this).attr('disabled', 'disabled');
haps();
});
Upvotes: 1