Matt Posted August 5, 2006 Share Posted August 5, 2006 I have a simple Guestbook function that I need some help... modifying.http://matt.artemis-fowl.com/tests/guestbook.phpI want to add a META Refresh that, after exactly three minutes, will take the information posted in the form and send it. So, basically, I want it as if the user has clicked submit after 3 minutes. Can this be done?Thanks!MattIf you need the code, just ask. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 5, 2006 Share Posted August 5, 2006 This can't be done reliably. About the only thing you can do is to use javascript to submit the form after a certain time, but if javascript is disabled this won't work. The other thing you can do is have a timestamp that gets submitted with the form, and check if the timestamp is more than 3 minutes old once the form gets submitted. The problem with this is that the user won't know they have gone over until they submitted. You can try a combination of both of these, but like I said, it's not very reliable or user-friendly. Link to comment Share on other sites More sharing options...
Matt Posted August 5, 2006 Author Share Posted August 5, 2006 It doesn't really have to be reliable/user-friendly, I just need it so it'll do it on most occasions. Is there any tutorials to help me do this? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 7, 2006 Share Posted August 7, 2006 I don't know of any tutorial. What you will need to do is use the javascript setTimeout function to trigger an event after a certain amount of time. The event you will want to trigger is the form's submit action. If you give your form an id:<form id="myform">The submit action in javascript would be something like this:document.getElementById("myform").submit(); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now