Welcome visitor
* Login
* Register
It is currently September 15th, 2019, 11:58 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » JavaScript



Post new topic Reply to topic  [ 4 posts ] 
Author Message
  submit a form in certain time
PostPosted: July 17th, 2009, 4:47 am 

Posts: 56
Im trying to have 2 ways to submit a form. One would be using the submit form, i've already figured that out.

The other is in which i could use some help. Do you know the code to automatically send a form after certain time?


Top
 Profile  
 
  Re: submit a form in certain time
PostPosted: July 17th, 2009, 11:08 am 
User avatar

Posts: 136
<script type="text/javascript">
var sec=30;
var time;
function autsend(){
    sec = sec - 1;
    time=setTimeout("autsend()",1000);
    if (sec==0){
        document.form.submit();
    }
}
</script>

the event will be after 30 sec, you can triger it on the body tag
<body onload="autsend()">

your form name should be form
<form name="form">

of course you can change that.


Top
 Profile  
 
  Re: submit a form in certain time
PostPosted: July 17th, 2009, 11:12 am 

Posts: 56
thanks for the script, let me give it a try.


Top
 Profile  
 
  Re: submit a form in certain time
PostPosted: July 17th, 2009, 11:16 am 

Posts: 56
awsome, its perfect!
thank you


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

FORUMS » Client Side » JavaScript


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron