I created a "form submitter" type of program that loads a webpage in an iFrame using PHP. The PHP reads data from a text file and then passes that data to JavaScript function that then loads the webpage src and then submits the data (fills in the input fields).
The problem here is that the JavaScript tries to fill in the data before the HTML is loaded in the iFrame. I'm tried using the onload event in the iFrame to kick-off the second function:
parent.fr1.document.onload= submit(data);
This seems to do the same as if I would just call the function. The onload event doesn't wait for the HTML to load!
How can I or what event can I use to tell the function not to submit until the HTML is loaded?
I also tried using the sleep() function in PHP. This halts the entire program. If there is a "doevents" in PHP I could loop that for about 10 seconds but I know of none. Any ideas?


Sign In
Create Account


Back to top









