How to disabe form double-submitsin Javascript

How to disabe form double-submitsin Javascript

In Internet Explorer few javascript submissions didn’t work.Here is the simplest bit of javascript code that worked in IE. We can just add the following code to submit button:

onclick=”this.disabled=true,this.form.submit();”

The javascript is executed the first time someone clicks the submit button. The first bit of code ‘this.disabled=true’ disables the button so it can’t be clicked again. The second bit of code ‘this.form.submit()’ then submits the form results (the form won’t work at all without this code). In the end, our form should look something like this:

<form>
<input type=”submit” value=”Send” onclick=”this.disabled=true,this.form.submit();”>
</form>

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.