View Full Version : Submit Once Code

10-24-2002, 03:52 PM
I am using Front Page to build my site.

I have several forms, a discussion board, and a database base, among other things.

I use front page to build my forms and the wizards in it are great.

The problem I am having tho, is one I am sure everyone has experienced. It's those darn click happy fingers, who hit submit more than once, and I end up with multiple posts in database and on discussion board.

I use to have the code for "submit once" but now I can't find it. :confused:

Can anyone help please?
Thanks in advance!

10-24-2002, 04:34 PM
you can do this to hold you off until someone finds that script..

function dis(){



then have

<input type="submit" name="SubmitButtonsName" onclick="dis()">

This works for IE browsers..

Hope it helps :D:D

10-24-2002, 06:15 PM
Thank You soooo much,

Here is the code for one of my forms, can you show me where to put what you have sent to me?

<td width="100%" bgcolor="#C0C8D8" height="487"><form method="POST" action="--WEBBOT-SELF--" onSubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1">
<!--webbot bot="SaveResults" startspan
S-Format="TEXT/CSV" S-Label-Fields="TRUE"
B-Reverse-Chronology="FALSE" S-Email-Format="TEXT/PRE"
S-Date-Format="%A, %B %d, %Y" S-Time-Format="%I:%M %p"
S-Builtin-Fields="Date Time"
U-Confirmation-Url="classifiedadconfirm.htm" --><strong>[FrontPage Save Results Component]</strong><!--webbot
bot="SaveResults" endspan -->
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" width="85%">
<td width="34%"></td>
<td width="66%"><font size="1" color="#CC3300">*
All Fields Required to Insure Your Ad will be
<td width="34%">Category*</td>
<td width="66%"><!--webbot bot="Validation"
B-Value-Required="TRUE" --><select size="1" name="category">
<option>Horse For Sale</option>
<option>Out of Area Horses</option>
<option>Pony For Sale</option>
<option>Tack/Apparel For Sale</option>
<option>Trailers/Trucks For Sale</option>
<option>Misc Items For Sale</option>
<td width="34%">Your Name*</td>
<td width="66%"><font size="1"><!--webbot
bot="Validation" S-Data-Type="String"
B-Value-Required="TRUE" --><input type="text" name="name" size="20">
First &amp; Last Required</font></td>
<td width="34%">Phone Number*</td>
<td width="66%"><font size="1"><!--webbot
bot="Validation" B-Value-Required="TRUE" --><input type="text" name="phone" size="20">
Area Code Required</font></td>
<td width="34%">E~Mail Address*</td>
<td width="66%"><!--webbot bot="Validation"
B-Value-Required="TRUE" --><input type="text" name="email" size="20">&nbsp;
<font size="1">Required</font></td>
<td width="34%">Ad Content*</td>
<td width="66%"><!--webbot bot="Validation"
B-Value-Required="TRUE" --><textarea rows="3" name="content" cols="35"></textarea></td>
<td width="34%">
<p align="center"></td>
<td width="66%" align="left" bgcolor="#CCFFFF"><a href="mailto:classifiedads@horseplaycentral.com">CLICK
HERE </a><font color="#000080">To attach a
<p><font color="#000080">All photos received
must meet certain requirements:&nbsp; .gif or
.jpeg format only.&nbsp; NO larger than&nbsp;
600 pixel wide X 600 pixel height</font></td>
<td width="34%"></td>
<td width="66%" align="left" bgcolor="#CCFFFF"><font color="#000080">Put
your FULL name and Phone Number in the subject
<td width="34%"></td>
<td width="66%" align="left" bgcolor="#CCFFFF"><font color="#000080">Any
photos received not meeting these requirements
will not be posted.</font></td>
<p align="center"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
<p align="left">&nbsp;</p>
<p align="left"><img border="0" src="../images/spacer350.gif" width="325" height="2"></a></p>

YOu guys are great on this forum!! So much help! Thank You!
~Susan :thumbsup:

10-24-2002, 06:21 PM
Ok I see where to the

<input type="submit" name="SubmitButtonsName" onclick="dis()">

But can't seem to find where to put the

function dis(){



Thanks again!!

10-25-2002, 03:58 PM
Okay you put the code like this.

<title>Whatever said the rabbit hehe</title>

<script language="javascript">

function dis(){





Your code here


You can change the name of the submit button,, just be sure to have it correspond with the javascript..;D:D;D

Hope it helps:D

10-25-2002, 05:05 PM
Why not just?

<input type="submit" name="SubmitButtonsName" onclick="this.disabled=true;">

instead of the function. The function is not needed for just one line of code....

However, there is a problem with this method. What if the form fails (the front page validator should prevent it from submitting). now you have an incomplete form with a submit button that is disabled.

It is much better to place the submit disabling code AFTER the successful validation of the form. You can add an additional function to handles this without having to manually edit the frontpage function.
function doForm(f) {
if (FrontPage_Form1_Validator(f)) {
return true;
return false;

<form onSubmit="return doForm(this)">And, that *should* do it. :D

10-25-2002, 05:49 PM
Wow! You all are amazing!

Thanks so much for your help!