Pyro Posted September 19, 2005 Share Posted September 19, 2005 I have a php script. This script takes a few variables via POST and performs an action, I would like to make a small page where this action is automaticly performed, since entering the form gets old and I don't want to use GET. Basically, I need a script that does, in the following order: Uses POST to provide a specific value for three different variables, which we can call "1", "2" and "3", without the need for an actual visible (well, it doesn't really matter if it's visible or not :P) form. Sends the visitor to the script which uses the POST-variables after a second or two. I have no idea how to do this and it would be awesome if someone could help me out. Hopefully I made some sense :) Link to comment Share on other sites More sharing options...
Pyro Posted September 19, 2005 Author Share Posted September 19, 2005 Hmm, the variable thing was simpler than I thought. What I do need however is still a script that triggers the submit button after a second or two. Link to comment Share on other sites More sharing options...
Hannibal Posted September 19, 2005 Share Posted September 19, 2005 ...... Link to comment Share on other sites More sharing options...
Pyro Posted September 20, 2005 Author Share Posted September 20, 2005 function onLoadAutoSubmit() { var form = document.getElementById("myForm"); setTimeout(form.submit, 2000); } Link to comment Share on other sites More sharing options...
____ Posted September 20, 2005 Share Posted September 20, 2005 onload="onLoadAutoSubmit();" edit: and I would personally just use static reference to the form.. setTimeout(document.myForm.submit, 2000); i believe that should work. the submit of javascript on the javascript side for a long time :P Link to comment Share on other sites More sharing options...
Pyro Posted September 20, 2005 Author Share Posted September 20, 2005 Tried both changes, still doesn't submit automaticly :/ Link to comment Share on other sites More sharing options...
Hannibal Posted September 22, 2005 Share Posted September 22, 2005 Tried both changes, still doesn't submit automaticly :/ any js errors in the js console? Link to comment Share on other sites More sharing options...
Ks_Jeppe Posted September 29, 2005 Share Posted September 29, 2005 Link to comment Share on other sites More sharing options...
____ Posted September 29, 2005 Share Posted September 29, 2005 hm, somehow that never works on my own machine :-? Link to comment Share on other sites More sharing options...
Pyro Posted September 30, 2005 Author Share Posted September 30, 2005 Works great! I need to work out a few details, but that should do the trick. Thank you everyone :) 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