ivyorg Posted April 4, 2001 Posted April 4, 2001 I have a database which operates as a test. I want to put an automatic time limit of 80 minutes on it. I can obviously do this with javascript, but how could I get it to automatically submit an -edit command upon the 80 minutes? I can't really do it with a URL link instead, because of the variability of the field entries. Any ideas?
elvis_impersonating_penguin Posted April 4, 2001 Posted April 4, 2001 well you would put this between the head (<head></head> ) commands on you document code: <script language="javascript'> <!---// function sendit(){ alert("Your 80 minutes are up, this form will now be submitted") document.forms[0].submit() } //---> </script> then put this in you body tag.. code: <body 0nL0ad="setTimeout('sendit()',4800000)"> make sure you change the zero in 0nL0ad to the letter "o". couldn't submit the form with and onload tag in it.. which is a pain in the butt. that should do it.. this is all assuming that the form is all on one page. if the form spans many many HTML pages this is going to be much much harder to do.. [ April 04, 2001: Message edited by: bman ]
ivyorg Posted April 12, 2001 Author Posted April 12, 2001 hm. it's not working. here's my code: <HEAD> <TITLE>Coaches Certification Test</TITLE> <META NAME=GENERATOR CONTENT="Claris Home Page 3.0"> <X-CLARIS-WINDOW TOP=56 BOTTOM=607 LEFT=14 RIGHT=813> <X-CLARIS-TAGVIEW MODE=minimal> <script language="javascript'> <!---// function sendit(){ alert("Your 80 minutes are up, this form will now be submitted") document.forms[0].submit() } //---></script> </HEAD> <BODY BGCOLOR="#FFF3D9" onl0ad="setTimeout('sendit()',60)"> the only thing i changed above is the "0" instead of the "o" in onload. hmm
elvis_impersonating_penguin Posted April 13, 2001 Posted April 13, 2001 what doesn't work.. does it just not submit.. or does it submit to soon. because you have a 60 in the set time out.. that should be a lot more than 60, settimeout is done it milisecond..so for 1 minute you 60000 so you 80 minutes you would need 4800000, as my original post said. so it should say setTimeout('sendit()',4800000) If thats not the problem than post again with a little more detail about the problem.
ivyorg Posted April 16, 2001 Author Posted April 16, 2001 Okay. Part of the problem was in the syntax, where I had typed "javascript' instead of "javascript" Luckily I still use claris home page so i could tell that the script wasn't "active" by the highlighting. Now, it does the auto-submit, but then i get an error 4 (unknown command) that doesn't occur if i manually submit it, it works fine. i'm not so good on javascript, so if you could help me figure out the offending command, i'd be very grateful! i'm psyched it's working this well already. thanks bevin
elvis_impersonating_penguin Posted April 16, 2001 Posted April 16, 2001 hmmm... well normally you would submit with a submit button so you would have code that looked similar to this <input type="submit" name="-new" value="submit"> or something similar, correct? well since you are not submitting it with that button you need to find another way of putting that -new in there somewhere. so just go ahead and put this code right near the submit button, probably just before it. <input type="hidden" name="-new"> that might fix it.. if you have already done that then i'm not sure what the problem will be... oh and sorry about putting the wrong quotes around javascript.. just looked at my first post and that was my fault.. guess i was typing it in a hurry. [ April 16, 2001: Message edited by: bman ]
ivyorg Posted April 17, 2001 Author Posted April 17, 2001 okay, genius boy, you're hired. thanks a lot!!
elvis_impersonating_penguin Posted April 17, 2001 Posted April 17, 2001 i'm hired? what are you paying??? haha
ivyorg Posted April 17, 2001 Author Posted April 17, 2001 i'll pay you the satisfaction and praise everytime you answer my questions!
elvis_impersonating_penguin Posted April 17, 2001 Posted April 17, 2001 woohoo.. sounds good to me.. but satifaction and praise aint gonna get me that new house. haha
Recommended Posts
This topic is 8690 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now