Search This Blog

Tuesday, January 19, 2010

Jquery: To prevent double submission

from http://jquery-howto.blogspot.com/2009/05/disable-submit-button-on-form-submit.html

// Prevent form double-submission
$('form').submit(function(){
$('input[type=submit]', this).attr('disabled', 'disabled');
$('select', this).attr('disabled', 'disabled');
$('input[type=text]', this).attr('readonly', 'readonly');
$('textarea', this).attr('readonly', 'readonly');
});

No comments:

Post a Comment