Reputation: 13315
In this code i am disabling the submit button when i clicked once and after 3000 ms i am making it enable..
This is working fine in Firefox but not in Chrome..
What's the wrong with this code ?
// to make all the submit button disable due to avoid duplicate entries.
$('.logged-in #edit-submit').click(function(){
var input = this;
input.disabled = true;
setTimeout(function() {
input.disabled = false;
}, 3000);
});
Upvotes: 0
Views: 260
Reputation: 26
The "disabled" attribute needs "disabled" as value (Doc). Best set and remove attributes with jQuery tools:
$('.logged-in #edit-submit').click(function(){
var input = this;
$(input).attr("disabled", "disabled");
setTimeout(function() {
$(input).removeAttr("disabled");
}, 3000);
});
You can see it working here: http://jsfiddle.net/christians/U9eDw/
Upvotes: 1