Solved

How do I get a form to submit after 5 minutes?

Posted on 2009-05-08
3
187 Views
Last Modified: 2012-05-06
Hi,

I have a form on a webpage that I'd like to have automatically submit after 5 minutes. What I know of javascript is pretty basic.  If someone could give me some pointers on how to get this done, I'd appreciate it.

Thank you in advance,
T
0
Comment
Question by:tn22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Expert Comment

by:SalmanZG
ID: 24342401
<form name="myForm">
</form>

<script language="JavaScript"><!--

setTimeout('document.myForm.submit()',300000);
//--></script>

Ref:
http://www.irt.org/script/956.htm
0
 
LVL 3

Accepted Solution

by:
janjerell earned 125 total points
ID: 24342421

<html>
	<head>
		<title>Submit form in 5 minutes</title>
 
		<script type='text/javascript' language='javascript'>
			
			function submitFromInPrefferedMinutes(minutes)
			{
				var SECONDPERMINUTE = 60;
				var MILLISECONDPERSECOND = 1000;
				
				var TotalInterval = ((minutes * SECONDPERMINUTE) *MILLISECONDPERSECOND);
				
				setTimeout("submitForm()", TotalInterval);
				
			}
			
			function submitForm()
			{
				document.frm.submit();
			}
			
			
			function init()
			{			
				submitFromInPrefferedMinutes(5);
			}
			
			window.onload = init;
			
			
		</script>
	</head>
	<body>
		<form name='frm'>
			<input type='text' />
			<input type='submit' />
		</form>
	</body>
	
</html>

Open in new window

0
 

Author Comment

by:tn22
ID: 24344897
Thank you!!
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question