There are potentially a few problems using javascript to control the number 
of submits:

#1 non-javascript compliant browser (there are still a few out there... ie 
some (all?) WAP browsers/handhelds

#2 What happens if the submit failed?  Then you just made the user restart 
the whole entry sequence over?


I think the session variable idea Daniel posted might be better since, 
since if the submit failed, the sesion variable will not be set.


At 11:00 AM 12/19/00 -0500, Larry C. Lyons you wrote:

>Jon,
>
>I use a bit of very simple JavaScript to change the button name. Here's
>an example:
>
>  <INPUT TYPE="Button" NAME="Submit" VALUE="Submit"
>onClick="if(this.value == 'Submit') this.form.submit(); this.value =
>'Please Wait.';">
>
>If the user clicks on the submit button, the script tests to make sure
>that the button is labelled Submit, if so it changes the button's label
>to Please Wait, and then continues with the submit, otherwise it does
>nothing. In other words if the button is labeled "Please Wait" it
>doesn't submit the form.
>
>hth,
>
>larry
>
>--
>Larry C. Lyons
>ColdFusion/Web Developer
>EBStor.com
>8870 Rixlew Lane, Suite 201
>Manassas, Virginia 20109-3795
>tel: (703) 393-7930 x253
>fax: (703) 393-2659
>http://www.ebstor.com
>http://www.pacel.com
>email: [EMAIL PROTECTED]
>
>Chaos, panic, and disorder - my work here is done.
>--
>
>
>Jon Gage wrote:
> >
> > Does anybody have any suggestions for preventing users from hitting a 
> submit
> > button multiple times?
> >
> > Thanks,
> > Jon
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to