473,493 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

onload Submit Google Form Endless Loop

3 New Member
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
1 2407
pronerd
392 Recognized Expert Contributor
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

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

Similar topics

1
2642
by: Richard Bell | last post by:
Why doesn't this seem to work? var win; // window handle function onloadfunction( arg ){ // replace cnn with google win.navigate( "http://www.google.com" );// never executes } win =...
10
9358
by: berg | last post by:
I'm trying to use the onload event to load a series of urls. What I find is that the onload function is only called one time no matter how large the array. Here is the onload function. var...
2
3174
by: Richard Jonas | last post by:
I'm trying to submit a form from a window.onload event as follows: <body> <form method="POST" action="http://www.website.co.uk" name=login> <INPUT TYPE=hidden NAME="Username"...
8
3321
by: horos | last post by:
hey all, Ok, a related question to my previous one on data dumpers for postscript. In the process of putting a form together, I'm using a lot of placeholder variables that I really don't care...
2
6038
by: tony wong | last post by:
i wish the html to submit the form once it is loaded. what should be the code here (alert("how 's the code here"))? Grateful if you could help me. Thanks a lot. Tony...
30
2146
by: Skybuck Flying | last post by:
I was just trying to figure out how some C code worked... I needed to make a loop to test all possible values for a 16 bit word. Surprise Surprise... C sucks at it... once again :D lol... C is...
0
1534
by: Fabio R. | last post by:
Every webform in my application inherit from a base custom class. In this class I override the OnLoad method and call the base.Onload in it. Sometimes, the OnLoad in the webform is not executed...
7
2342
by: David T. Ashley | last post by:
Hi, For a web page, I want a SUBMIT button that commits the form data and a CANCEL button that goes to a different target (i.e. a different script). I haven't figured out how to do this,...
0
7119
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7367
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1400
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.