Form "Submit once only" problems

D

David Bradbury

Hi

On my form, as soon as the user clicks my submit button a message pops
up saying "Form processing" as the form submits. This is fine as long
as the user only clicks the submit button once. However, if I try and
stop the user submitting a second time (if they click the button for a
second time despite the form processing message) by using a submission
counter then my form just hangs forever with the "Form processing"
message. Any ideas? Here's the javascript:

<script language="JavaScript">
<!--
var submitcount = 0


function checkMe(){
if (submitcount ==0){
with(document.forms.worldcup){
if(name.value == ""){
alert("You must enter your name")
return;
}

if(company.value == ""){
alert("You must enter your company");
return;
}


if(email.value.indexOf("@") == -1){
alert("You must enter a valid e-mail address")
return;
}




submitcount++
document.all.pleasewaitScreen.style.display="block";
document.forms.worldcup.submit();



}}

}
//-->
</script>

The document.all.pleasewaitscreen is a div tag as follows:

<DIV ID="pleasewaitScreen" STYLE="position:absolute;z-index:5;
top:50%; display:none; width:100%;">
<TABLE ALIGN="CENTER" BGCOLOR="#000000" BORDER="1"
BORDERCOLOR="#000000" CELLPADDING="0" CELLSPACING="0" HEIGHT="50"
WIDTH="150" ID="Table1">
<TR>
<TD WIDTH="100%" HEIGHT="100%" BGCOLOR="silver" ALIGN="CENTER"
VALIGN="MIDDLE">
<FONT FACE="Arial" SIZE="4" COLOR="blue"><B>Processing<br>
Please Wait</B></FONT>
</TD>
</TR>
</TABLE>
</DIV>


And finally, the user submits when they click on an image of a
football:

<p> <a href="javascript:checkMe();"><img
src="images/footballsubmit.jpg" border="0"></a>
 
S

steve stevo

Have you tried disabling the submit button after form starts processing ?

hope this helps

Simon Christie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top