View Full Version : Submitting a Form on Page Load

09-28-2002, 10:10 PM

Im looking for a way of submitting a form each time a page is loaded, the form will send an sms when certain conditions are met. I cant use a button for this, so i need some way of doing it automatically.

Currently i am trying:

<BODY onLoad="document.body.monitor.submit()">

<form method="POST" action="http://webstrikesms.com/sms.exe/" name="monitor">
<input type="hidden" name="FromEmail" value="monitoring">
<input type="hidden" name="TextMessage" value="monitoring">



09-29-2002, 05:03 AM
Don't know much about wireless - but this:

<BODY onLoad="document.body.monitor.submit()">

...has one too many objects (guess which). Using the onload handler like this could get you into an endless loop; 'when certain conditions are met' is kind of mysterious. Might want to write something (at the server) to a hidden field as a flag to determine (client-side) whether the data in question has already been sent.

<body onload="if(document.monitor.sendflag.value=='send')document.monitor.submit()">