By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,341 Members | 1,553 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,341 IT Pros & Developers. It's quick & easy.

onload Submit Google Form Endless Loop

P: 3
I have a page that uses php to process a form and send the results to the page that is misbehaving.

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
  1. <script language="JavaScript" type="text/javascript">
  2. function GoogleSet(){
  3.  // quit if this function has already been called
  4. if(GoogleVar){
  5.   GoogleVar = false;
  6.   // flag this function so we don't do the same thing twice
  7. document.getElementById('sa').click();
  8. }
  9. }
  10. </script>
Apr 18 '08 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 392
except the page gets caught in and endless loop.
How do you know? What is it that actually happens?



What is it about onload that is tormenting me?
Since your question relates to the onload event then you need to show code that sets the onload event.
Apr 19 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.