By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,504 Members | 1,092 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,504 IT Pros & Developers. It's quick & easy.

Form "Submit once only" problems

P: n/a
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>
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Have you tried disabling the submit button after form starts processing ?

hope this helps

Simon Christie

"David Bradbury" <da***********@etoast.com> wrote in message
news:49**************************@posting.google.c om...
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>

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.