|
 |
asp_web_howto thread: Cause a form to automatically submit.
Message #1 by "Brice, Charles" <Charles.Brice@u...> on Wed, 31 Jul 2002 11:51:41 -0400
|
|
Hi all
How can I cause a form to automatically submit after a controlled amount of time?
Do I have to have ASP generate JavaScript statements? If it needs to be
JavaScript how do I call the function with out an onClick or other event.
It needs to submit after the timer expires.
Can you give me a code sample?
Thanks
Charles
Message #2 by Greg Griffiths <greg2@s...> on Wed, 31 Jul 2002 19:46:23 +0100
|
|
checkout the setTimeout function in Javascript, this with the form
submission as the action should solve you problem.
At 11:51 31/07/02 -0400, you wrote:
>Hi all
>
>How can I cause a form to automatically submit after a controlled amount
>of time?
>Do I have to have ASP generate JavaScript statements? If it needs to be
>JavaScript how do I call the function with out an onClick or other event.
>It needs to submit after the timer expires.
>
>Can you give me a code sample?
>
>Thanks
>Charles
>
>
>
>
>---
>
>Improve your web design skills with these new books from Glasshaus.
>
>Usable Web Menus
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
>r-20
>Constructing Accessible Web Sites
>http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
>r-20
>Practical JavaScript for the Usable Web
>http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
>r-20
Message #3 by "Drew, Ron" <RDrew@B...> on Wed, 31 Jul 2002 18:15:31 -0400
|
|
Try something like this...I have not tested it..
<SCRIPT LANGUAGE=3Djavascript>
<!--
function CloseAndSubmit () {
document.form.submit()
self.close();
}
function settime(){
setTimeout("CloseAndSubmit()", 200);
}
//-->
</SCRIPT>
</HEAD>
.......the onload can be either on the body or form
<BODY onLoad=3D"settime()">
-----Original Message-----
From: Brice, Charles [mailto:Charles.Brice@u...]
Sent: Wednesday, July 31, 2002 11:52 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Cause a form to automatically submit.
Hi all
How can I cause a form to automatically submit after a controlled amount
of time? Do I have to have ASP generate JavaScript statements? If it
needs to be
JavaScript how do I call the function with out an onClick or other
event.
It needs to submit after the timer expires.
Can you give me a code sample?
Thanks
Charles
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
|
|
 |