struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <>
Subject RE: [OT] JavaScript auto-submit form
Date Mon, 09 Sep 2002 09:45:33 GMT
Hmm. Seems a correction is in order.

It seems that if other javascripts on the page have compilation problems,
this can stop NS6 invoking its onload behaviour (while it would seem that IE
and Mozilla are not so badly affected).

Thanks to Arron Bates for pointing this out to me. :-)

Reducing my test form to a much simpler case made it work, so must have been
some other problem among all the other garbage in the page (yep. I was
trying to save time by tacking my experiments onto an existing page which Id
been using to experiment with other things!) as the following works fine in

<body onload="document.forms[0].submit()">
<form action="" name="f">
<input maxlength="256" size="55" name="q" value="struts">

-----Original Message-----
From: Andrew Hill []
Sent: Monday, September 09, 2002 14:40
To: Struts Users Mailing List
Subject: RE: [OT] JavaScript auto-submit form

Been trying to duplicate your results.

I was experimenting with using (body tag)
onload="document.forms['formname'].submit();" to submit the form as soon as
it had loaded (this can be a useful way of posting parameters to other
applications). This worked in Mozilla, and IE5. It didnt work in Netscape 6
(esentially an earlier version of Mozzila).
Furthermore, changing to onload="alert('hello');" worked in IE5 and Mozilla,
but again failed in Netscape 6. It rather looks like NS6 doesnt support the
onload attribute for the body tag! Can this be true - perhaps its a bug in
the NS version of Mozilla that was fixed later?

I _was_ however able to submit the form from a script block after the form
in all three browsers. What exactly was the nature of the problem trying to
submit from a script block in mozilla?

<form action="" name="f">
<input type="hidden" name="hl" value="en"/>
<input maxlength="256" size="55" name="q" value="struts"/>

-----Original Message-----
Sent: Saturday, September 07, 2002 01:41
Subject: RE: [OT] JavaScript auto-submit form

here is a snippet from one of my pages...  You only need the submit
Works in mozilla (I use it)

<script language="JavaScript">
function selectChange(txt) {
    document.FormDrillDownReport.elements[0].value = 'changed' + txt;

<form name="FormDrillDownReport" method="POST"
<input type="hidden" name="action" value="">
<select name="groupSelection" onchange="selectChange('Group');"><option
value="" selected="selected">Select a group</option>
<option value="8046">MFGAD</option>
<option value="8047">PROD</option>
<option value="8048">QA</option>

Now, I am gonna go find Mark and some beers...

-----Original Message-----
From: cbartl03 []
Sent: Thursday, September 05, 2002 4:24 PM
To: struts-user
Subject: RE: [OT] JavaScript auto-submit form

What do you mean by "auto-submit"?  When should the form be
submitted?  On page load?  When the user has filled out all the fields?

> -----Original Message-----
> From: Eddie Bush []
> Sent: Thursday, September 05, 2002 3:13 PM
> To: Struts Users List
> Subject: [OT] JavaScript auto-submit form
> Could any of you suggest a way for me to get Netscape/Mozilla to
> auto-submit a form via JavaScript?  I have two ways that work
> just fine
> under IE and Opera ... but, ... suffice it to say I'd like a
> cross-browser solution :-)
> Things I have tried:
>     * A JavaScript <script> block after the form that would
> invoke the
> forms submit method.
>     * A function defined in the <head> that is invoked as the onload
> event for the body.
> IE and Opera do fine either way.  Mozilla ... doesn't.  Suggestions
> (other than "don't support Mozilla!")?  How do you guys do
> auto-submit
> forms in Netscape/Mozilla?
> Thanks!
> Eddie
> --
> To unsubscribe, e-mail:
> <>
> For additional commands, e-mail:
> <>

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message