Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Re: SubmitOnce


Message #1 by Greg Griffiths <griffiths@x...> on Wed, 05 Dec 2001 10:13:48 +0000
why not set a flag field on the form, and when they press submit test it, 
if it is true, then fail the submit. You may also be able to do some 
checking on the server side.

var alreadySubmitted;
alreadySubmitted=false

function testSubmit()
{
         if (alreadySubmitted)
         {
                 alert("No way hosea");
         }
         else
         {
                 alreadySubmitted=true;
                 document.<form name>.submit();
         }
}

At 18:49 26/11/01 -0500, you wrote:
>Hi to all,
>I have a problem with a form because users submit it more than once, so I 
>got duplicate records in the DB. I want to stop them from sending more 
>than once. I created a function, but works only in IE. Does anybody know 
>something that can work in different browseers?
>
>Thanks
>Nato
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>


  Return to Index