SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Resource

Multiple Form Posts


Sponsored Links
Developer's Paradise : Inside Technique :
Multiple Form Posts
Submission by SiteExperts Staff

Go to the resource:
Multiple Form Posts

Add to Assistant

Short Description
A technique for preventing forms from being submitted multiple times.

Long Description
Allowing the same form to submit itself multiple times can create real problems for your web-site. For example, orders can be submitted multiple times and discussion groups can end up with the same message over and over agian. In this article we explore a solution we will be deploying on our site.

Author
Scott Isaacs
Submission URL
http://www.SiteExperts.com/tips/backend/ts04/page1.asp
Submission Date
Dec 27,1998
Last Update
Dec 27,1998
 

Discussion and Rate this Resource
Overall Rating: 3.5

Lee on Jan 12, 1999 at 3:49:19 AMRating: 1
Sessions in ASP and NT is not a good idea, since it can crash your computer if traffic is high. It can low memory, decrease performance, etc.

We had experienced with heavy traffic and the machine simply stops the "ASP service". The only solution is booting it.

Here is my solution to prevent multiple form posts. It's simple and works with all browsers.
Writen in Javascript. You can change as you can.


<SCRIPT language="JavaScript">
var sent=false;
function confirm(){
node1=document.formname;
name=node1.name.value;
phone=node1.phone.value;
if (sent){
alert("Sorry, but you had submited!")
// or could be:
// location="http://www.yourcompany.com/already.htm"
return;
}
node1.submit();
sent=true;
}
}
</SCRIPT>

<TITLE>Demo</TITLE>

Please Fill the form:
<P>
<!-- the target was put intentionally to show the submit's properties -->
<FORM name="formname" method=post
action="http://www.yourcompany.com/yourcgi"
onSubmit="confirm()" target="newpage">
Name: <INPUT type=text name="name" value="" size=30><BR>
Phone: <INPUT type=text name="phone" value="" size=20><P>
<INPUT type=submit value=" OK ">
</FORM>
</HTML>

Most Recent Ratings/ Comments


To rate and comment on a resource, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password

Copyright © 1997-2008 InsideDHTML.com, LLC. All rights reserved.