473,698 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

timer submit submits more than once

20 New Member
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 1330
jhardman
3,406 Recognized Expert Specialist
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 New Member
Thank you Jared! I will look into cookies then.
Aug 9 '07 #3
fluff
20 New Member
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
5072
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. 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...
4
4388
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 takes an extra 35 seconds, but has taken an extra 2.5 minutes in some cases. Any ideas what might be the cause? And more importantly - the fix? Code snippet below... Thanks, Christine
4
2009
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 the submit button. When the user clicks submit, the value of the button changes to "Processing..." and the button disables. The cgi to which it is submitting will process the data and render the
4
7593
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 code : ----------- <SCRIPT> function touche_EnterKeyPress(){
11
2143
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 page I have more than one web control that have their independient "forms" (in the .NET environment, it makes it to be just one). And I need that, if the user is, say, writing the keywords to perform a search, the enter key submits this form, but...
19
3099
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. Thanks Arun
1
2576
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 navigation page, it will save the page without need to click on 'Save' button. Currently, if i manually clicked on the 'Save' button; it will save the page.
10
6082
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 different results than when I use a javascript submit: form1.submit();. I think the javascript submit is working as it should, since I want the server to process an __EVENTTARGET posting. When I click the submit button, it does not process the...
13
10559
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 user clicks "yes" or "no". This Object is attached to various HTML elements on the page (buttons, selects etc) and traps any events that they raise that cause the page to submit. If the user has not responded, the Object should cancel the page...
0
9029
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7729
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.