Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Oct 2002
    Location
    California
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Submit Once Code

    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.

    Can anyone help please?
    Thanks in advance!
    ~susan

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you can do this to hold you off until someone finds that script..

    function dis(){

    document.forms[0].SubmitButtonsName.disabled=true

    }

    then have

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

    This works for IE browsers..

    Hope it helps
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #3
    New to the CF scene
    Join Date
    Oct 2002
    Location
    California
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

    <tr>
    <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
    U-File="../_private/form_results.txt"
    S-Format="TEXT/CSV" S-Label-Fields="TRUE"
    B-Reverse-Chronology="FALSE" S-Email-Format="TEXT/PRE"
    S-Email-Address="classifiedads@horseplaycentral.com"
    B-Email-Label-Fields="TRUE"
    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%">
    <tr>
    <td width="34%"></td>
    <td width="66%"><font size="1" color="#CC3300">*
    All Fields Required to Insure Your Ad will be
    Posted</font></td>
    </tr>
    <tr>
    <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>
    </select></td>
    </tr>
    <tr>
    <td width="34%">Your Name*</td>
    <td width="66%"><font size="1"><!--webbot
    bot="Validation" S-Data-Type="String"
    B-Allow-Letters="TRUE"
    B-Allow-WhiteSpace="TRUE"
    B-Value-Required="TRUE" --><input type="text" name="name" size="20">
    First &amp; Last Required</font></td>
    </tr>
    <tr>
    <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>
    </tr>
    <tr>
    <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>
    </tr>
    <tr>
    <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>
    </tr>
    <tr>
    <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
    photo.&nbsp;&nbsp;</font>
    <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>
    </tr>
    <tr>
    <td width="34%"></td>
    <td width="66%" align="left" bgcolor="#CCFFFF"><font color="#000080">Put
    your FULL name and Phone Number in the subject
    line.</font></td>
    </tr>
    <tr>
    <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>
    </tr>
    </table>
    </div>
    <p align="center"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
    </form>
    <p align="left">&nbsp;</p>
    <p align="left"><img border="0" src="../images/spacer350.gif" width="325" height="2"></a></p>
    </td>
    </tr>

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

  • #4
    New to the CF scene
    Join Date
    Oct 2002
    Location
    California
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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(){

    document.forms[0].SubmitButtonsName.disabled=true

    }


    Thanks again!!

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay you put the code like this.

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

    <script language="javascript">

    function dis(){

    document.forms[0].SubmitButtonsName.disabled=true

    }

    </script>

    </head>
    <body>

    Your code here

    </body>
    </html>

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


    Hope it helps
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #6
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Code:
    <script>
    function doForm(f) {
    	if (FrontPage_Form1_Validator(f)) {
    		f.SubmitButtonsName.disabled=true;
    		return true;
    		}
    	return false;
    	}
    </script>
    
    <form onSubmit="return doForm(this)">
    And, that *should* do it.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #7
    New to the CF scene
    Join Date
    Oct 2002
    Location
    California
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wow! You all are amazing!

    Thanks so much for your help!

    ~Rides


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •