Skip to main content
added [http-post] to 337 questions - Shog9 (Id=811)
Link
Question Protected by CommunityBot
Format the code, making it more consistent and easier to read.
Source Link

I have ana form that takes a little while for the server to process. I need to ensure that the user waits and does not attempt to resubmit the form by clicking the button again. I tried using the following jQuery code:

<script type="text/javascript"> $(document).ready(function() { $("form#my_form").submit(function() {   $('input').attr('disabled', 'disabled');   $('a').attr('disabled', 'disabled');   return true;   });  }); </script> 

When I try this in Firefox everything gets disabled but the form is not submitted with any of the POST data it is supposed to include. I can't use jQuery to submit the form because I need the button to be submitted with the form as there are multiple submit buttons and I determine which was used by which one's value is included in the POST. I need the form to be submitted as it usually is and I need to disable everything right after that happens.

Thanks!

I have an form that takes a little while for the server to process. I need to ensure that the user waits and does not attempt to resubmit the form by clicking the button again. I tried using the following jQuery code:

<script type="text/javascript"> $(document).ready(function(){ $("form#my_form").submit(function(){ $('input').attr('disabled','disabled'); $('a').attr('disabled','disabled'); return true;   })  }); </script> 

When I try this in Firefox everything gets disabled but the form is not submitted with any of the POST data it is supposed to include. I can't use jQuery to submit the form because I need the button to be submitted with the form as there are multiple submit buttons and I determine which was used by which one's value is included in the POST. I need the form to be submitted as it usually is and I need to disable everything right after that happens.

Thanks!

I have a form that takes a little while for the server to process. I need to ensure that the user waits and does not attempt to resubmit the form by clicking the button again. I tried using the following jQuery code:

<script type="text/javascript"> $(document).ready(function() { $("form#my_form").submit(function() {   $('input').attr('disabled', 'disabled');   $('a').attr('disabled', 'disabled');   return true; }); }); </script> 

When I try this in Firefox everything gets disabled but the form is not submitted with any of the POST data it is supposed to include. I can't use jQuery to submit the form because I need the button to be submitted with the form as there are multiple submit buttons and I determine which was used by which one's value is included in the POST. I need the form to be submitted as it usually is and I need to disable everything right after that happens.

Thanks!

edited tags
Link
Adam
  • 45.1k
  • 17
  • 107
  • 145
Source Link
Adam
  • 45.1k
  • 17
  • 107
  • 145
Loading