473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 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 5028
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Pete Mahoney | last post by:
Ok I use a textarea to store data input by the user, and then upon them clicking the submit button I store this data to a database. The problem is once the user inputs too much data (about 3...
2
by: Laermans_k | last post by:
Hi, Does anyone have a solution to use the <input type="file" id="filechooser"> and the <input type="submit" id="submitbutton"> in 1 button click? I've already tried to create a javascript...
3
by: Adam | last post by:
Hey guys, I've decided to stop banging my head against the wall and just ask you guys for the answer. I can't seem to find it. I have a form in which I have multiple submit buttons; only, I'm...
5
by: Alex Maghen | last post by:
In ASPX 2.0 with MasterPages and all that, my entire page only has one actual <FORM>. But there are several different sections of the page that provide what are functionally separate forms with...
4
by: Martin | last post by:
I have a form with two submit buttons: <Save> and <Cancel>. When the user clicks on <Save>, I want to execute a validate function. When he clicks on <Cancel>, I want the form to submit without...
2
by: mattgarvin | last post by:
Hello, I need a piece of javascript that will allow a form to be submitted when Enter is pressed for IE6 and 7, Firefox 2, and recent versions of Safari. It is for a login page that has two...
5
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I have been using the Click Once deployment feature of VS2005 - very nice. I had IE6 at the time when I started using Click Once Deployment, and everything worked fine. But then my...
3
by: Rahul Babbar | last post by:
Hi, I had the following doubts about the "For Read Only" clause. 1. How does a "for Read only" clause improve the performance? 2. How does a "for Read only" clause compare with "With UR"...
0
by: stephen | last post by:
Hi, I am using Click Once Deploy to deploy an application.(this application has an .exe, .config, .xml files) and after deployment to a location, I checked for the files and all the files are...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.