473,396 Members | 1,702 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,396 software developers and data experts.

timer submit submits more than once

20
Hello

I am using frontpage 2002 and asp.
I have a form that submits after the user clicks submit and if the user forgets to click submit, the page submits after a couple of minutes.
It works fine most of the time, but when it submits with the timer, sometimes it goes in the db many times. When the user clicks submit, it goes in once. When the user doesn't click submit, sometimes the data goes in once and sometimes several times. Whats up with that?
Can someone help me?
Aug 8 '07 #1
3 1312
jhardman
3,406 Expert 2GB
fluffy,

I don't know why that would be the case, but you could easily fix this by assigning a cookie or a session level variable when the user first submits the form, and if that variable is already assigned, don't save to the db.

Jared
Aug 8 '07 #2
fluff
20
Thank you Jared! I will look into cookies then.
Aug 9 '07 #3
fluff
20
Hey Jared! I think I fixed it. I had javascript like this for textbox onchange event:
Expand|Select|Wrap|Line Numbers
  1. function startTimer()
  2. {
  3. timerID = setTimeout("document.myform.submit();",120000);
  4. }
but I changed it to this:
Expand|Select|Wrap|Line Numbers
  1. var timerID ="";
  2.  
  3. function restartTimer()
  4. {
  5. if (timerID != ""){
  6. clearTimer();}
  7. startTimer();
  8. }
  9.  
  10. function startTimer()
  11. {
  12. timerID = setTimeout("document.myform.submit();",120000);
  13. }
  14.  
  15. function clearTimer()
  16. {
  17. clearTimeout(timerID);
  18. }
So far the data's only going in once=)
Aug 10 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: David Bradbury | last post by:
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....
4
by: Christine | last post by:
I've implemented a countdown timer for a tutorial web page that should give the user 45 minutes to complete the test, only to find that the timer is slowly 'losing' time. On average, it actually...
4
by: Frank Way | last post by:
Hi all, I've googled this one to death, and still can't find an answer. Not sure I'm asking the right question, but here goes: Have a form with an onSubmit that has some javscript to disable...
4
by: Peloux | last post by:
Hi, I have written some htc in order to validate data in a form. most of htc are attached on 'onblur' event. Now, we would like to use the Enter Key to sublit form, so we use the following...
11
by: Sandra Castellanos | last post by:
Hello, I want to know what I have to do to make the enter key to submit forms. I read in another newsgroup that inserting an html hidden text box made the trick, and it actually does, but in my...
19
by: arunkumar_m2001 | last post by:
Can Somebody help me to code a timed test. Actually I want to implement a timer in a web application which will pop-up an alert automatically by refreshing the web page after a specific time. ...
1
by: kkuniya | last post by:
Situation : - A form (method : POST, action : itself, onsubmit : alert 'Submit' ) - Got 2 submit button ( 'Save' , 'View') - Got navigation 1|2|3|4 What I want to do : - Once clicked on the...
10
by: ljlolel | last post by:
So.. I have a form that submits to an ASP.net site made in C-sharp. The ASP site is not mine, i do not have the server side code. When I submit from my form by pressing the Submit button, I get...
13
Frinavale
by: Frinavale | last post by:
I've been trying all morning to cancel a form submit to the server. I have a JavaScript Object that determines whether or not the page should be submitted to the server depending on whether the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.