Pressing the submit button after amount of time ?!

I need some help with some javascript

Page 1 of 1

7 Replies - 11164 Views - Last Post: 18 July 2007 - 02:57 PM

#1 cherva   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 16
  • Joined: 14-April 07

Pressing the submit button after amount of time ?!

Posted 18 July 2007 - 06:01 AM

Hi all,
I need some help i have an HTML page with a form on it.
I simple need a script witch will press the submit button after a while (3 sec for instance)
Thanks in advance
Is This A Good Question/Topic? 0
  • +

Replies To: Pressing the submit button after amount of time ?!

#2 PennyBoki   User is offline

  • D.I.C Lover
  • member icon

Reputation: 55
  • View blog
  • Posts: 2,345
  • Joined: 11-December 06

Re: Pressing the submit button after amount of time ?!

Posted 18 July 2007 - 06:43 AM

Hi, you posted in the wrong forum cherva I think that you should try HTML/CSS/Javascript forum
Was This Post Helpful? 0
  • +
  • -

#3 1lacca   User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: Pressing the submit button after amount of time ?!

Posted 18 July 2007 - 07:14 AM

Moved to HTML/Javascript forum.
Was This Post Helpful? 0
  • +
  • -

#4 cherva   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 16
  • Joined: 14-April 07

Re: Pressing the submit button after amount of time ?!

Posted 18 July 2007 - 11:25 AM

Come on no one here can do this ?
Was This Post Helpful? 0
  • +
  • -

#5 girasquid   User is offline

  • Barbarbar
  • member icon

Reputation: 109
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Re: Pressing the submit button after amount of time ?!

Posted 18 July 2007 - 11:31 AM

Just use Javascript's setTimeout() function to do something like this:
window.setTimeout("pushSubmit()",3000);
function pushSubmit() {
	document.getElementById('myFormID').submit();
}


Was This Post Helpful? 0
  • +
  • -

#6 cherva   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 16
  • Joined: 14-April 07

Re: Pressing the submit button after amount of time ?!

Posted 18 July 2007 - 01:59 PM

I have a little problem here is my code:
<form action="/servlet/passportlogin" method="post" name="LogInForm">
<input type="text" name="username" >
<input type="text" name="password" >
<input class="b" id="w100" type="Submit" name="LOGIN_LOGIN" value=" LOGIN ">
</form>
<script LANGUAGE="Javascript">
window.setTimeout("pushSubmit()",3);
function pushSubmit() {
	document.getElementById('LogInForm').submit();
}


And.... it's not working ?!
Was This Post Helpful? 0
  • +
  • -

#7 snoj   User is offline

  • Married Life
  • member icon

Reputation: 93
  • View blog
  • Posts: 3,583
  • Joined: 31-March 03

Re: Pressing the submit button after amount of time ?!

Posted 18 July 2007 - 02:20 PM

Probably because you don't have an element with the id set to "LogInForm"?
Was This Post Helpful? 0
  • +
  • -

#11 cherva   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 16
  • Joined: 14-April 07

Re: Pressing the submit button after amount of time ?!

Posted 18 July 2007 - 02:57 PM

My bad I Fixed it there is the full page for the people who will have the same problem and need a working page:
<form action="/servlet/passportlogin" method="post" name="LogInForm" id="LogInForm">
<input type="text" name="username" >
<input type="text" name="password" >
<input class="b" id="w100" type="Submit" name="LOGIN_LOGIN" value=" LOGIN ">
</form>
<script LANGUAGE="Javascript">
window.setTimeout("pushSubmit()",3);
function pushSubmit() {
	document.getElementById('LogInForm').submit();
}


This post has been edited by cherva: 18 July 2007 - 03:00 PM

Was This Post Helpful? 1

Page 1 of 1