jQuery disable button intercepts Request Object

Scenario: Hijack all my save buttons via the script below to override the value, from Save to Saving...., and then also disabling the button so they cannot hit it 1000 times.

$(document).ready(function() {
   form.find(':submit').each(function() {
      $(this).attr("disabled", "disabled").val("Saving....");
   });
});


The Issue: I have several submit type buttons on the page, like Save, Sand and Proceed, Delete, etc, so I use the Request.Form object to see what button was pressed to decide what to do. Well, the disable of the button by jQuery removes it from the Reuquest stream, even though it is only disabled after the click event has occurred, how strange.

The Solution: I don't know what the solution is other than removing the disable as below. Any ideas?

$(document).ready(function() {
   form.find(':submit').each(function() {
      $(this).val("Saving....");
   });
});

Print | posted @ Thursday, September 17, 2009 6:39 PM

Comments on this entry:

Gravatar # re: jQuery disable button intercepts Request Object
by Free Mp3 Download at 12/15/2009 1:55 PM

i tried this on my own blog and i must say it works awesome!!! cheers!!!
Post A Comment
Title:
Name:
Email:
Comment:
Verification: