This option will reset the home page of this site. Restoring any closed widgets or categories.

Reset

Disable submit button on form submit

Multiple form submission is one of the issues that a webmaster face during his development.So instead of writing a hardcore code in the server side.We can just validate a multiple submission using simple client side Jquery.
Consider we have this HTML form in our code:

<form id="check" action="someUrl.php" method="get"> <input name="username" />
<!-- some more form fields -->
<input id="submit" type="submit" />
</form>

Here is a jQuery code that disables submit button on form submission:

$('#check').submit(function(){
$('input[type=submit]', this).attr('disabled', 'disabled');
});
The above jQuery code binds a submit event to our #check form, then finds its submit button and disables it.

Disable submit button on form submission for all forms on your page.


// Find ALL <form> tags on your page
$('form').submit(function(){
    // On submit disable its submit button
    $('input[type=submit]', this).attr('disabled', 'disabled');
});

Thanks HOW TO JQUERY

VN:F [1.5.7_846]
Rating: 10.0/10 (1 vote cast)
VN:F [1.5.7_846]
Rating: 0 (from 0 votes)

Related posts:

  1. Disable the TRACE and TRACK For More Security
  2. Send Email to Multiple Persons using php
  3. Simple PHP mail Script
  4. Load Another Webpage Content Using Simple Jquery
  5. View webpage source using javascript
  6. Expand and collapse toggle div using jquery
  7. Jquery Basics, How to use jquery?

Leave a Reply

Comments (required)

Spam Protected