The php fills in the form fields on the new page.
I use javascript that executes onload and submits the form to Google.
The form submits to itself and the results from Google are posted below the form.
Everything works as expected, except the page gets caught in and endless loop.
I tried testing for and erasing the variable that gets passed to Google, but it doesn't matter. I have tried using submit() on the form and click() on the button, but get the same results.
If I don't process the form onload and instead just click the submit button, everything works perfectly.
What is it about onload that is tormenting me?
THe code is short.
Thanks.
Expand|Select|Wrap|Line Numbers
- <script language="JavaScript" type="text/javascript">
- function GoogleSet(){
- // quit if this function has already been called
- if(GoogleVar){
- GoogleVar = false;
- // flag this function so we don't do the same thing twice
- document.getElementById('sa').click();
- }
- }
- </script>