faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

10 of 25 people (40%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

How to avoid submitting the form twice?

Apr 7th, 2008 23:04
ha mo, Rajesh Narayanan,


This is one of the cause of the problem. 
The document.formName.submit() function may be called from a event that 
will also submit the form by virtue of its nature.
For example:
<html>
<head>
document.myForm.submit();
</head>
<body>
<form name="myForm">
<input type="image" src="../images/g.gif" onClick="JavaScript: 
imageClicked();"/>
</form>
</body>
</html>
The above example may submit the form twice sometimes.
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com