Hello Friends,

Form submission is one of the most frequently used actions in developing web application. If form submit two times than it will create lots of problems so you must take care about submitting form. One of the way is to restrict user by disabling the submit button using jQuery once form submit.

<form id="frm" action="index.php" method="post">

    <input name="name" id="name" />

    <input name="email" id="email" />

    <input id="submit" type="submit" />

</form>

Below is a jQuery code to disable submit button once form submitted:

$('#frm').submit(function(){

    $('input[type=submit]', this).attr('disabled', 'disabled');

});

//If you want to disable all forms' submit button than below is the code.

$('form').submit(function(){

    $('input[type=submit]', this).attr('disabled', 'disabled');

});

 

If you find any problem in this than let me know by comment.

To know more about programming,JavaScript issues,jQuery,Expression Engine,MYSQL database and Open-source, enter your email address below. We will send you free tutorials.

Enter your email address:
 
Feel free to ask any question. Just leave your comment below and we will answer your comment with in 24 hours.
rax rss Disable submit button with jQuery  rax twitter Disable submit button with jQuery  rax facebook Disable submit button with jQuery  rax myspace Disable submit button with jQuery