April 4, 200124 yr 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?
April 4, 200124 yr 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 ]
April 12, 200124 yr Author 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
April 13, 200124 yr 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.
April 16, 200124 yr Author 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
April 16, 200124 yr 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 ]
April 17, 200124 yr Author i'll pay you the satisfaction and praise everytime you answer my questions!
April 17, 200124 yr woohoo.. sounds good to me.. but satifaction and praise aint gonna get me that new house. haha
Create an account or sign in to comment