472,133 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

Form "Submit once only" problems

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
1 4879
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.

Similar topics

5 posts views Thread by Alex Maghen | last post: by
4 posts views Thread by Martin | last post: by
2 posts views Thread by mattgarvin | last post: by
5 posts views Thread by =?Utf-8?B?UmljaA==?= | last post: by
3 posts views Thread by Rahul Babbar | last post: by
reply views Thread by stephen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.