struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <andrew.david.h...@gridnode.com>
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
NS6:

<html>
<body onload="document.forms[0].submit()">
<form action="http://www.google.com/search" name="f">
<input maxlength="256" size="55" name="q" value="struts">
</form>
</body>
</html>




-----Original Message-----
From: Andrew Hill [mailto:andrew.david.hill@gridnode.com]
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="http://www.google.com/search" name="f">
<input type="hidden" name="hl" value="en"/>
<input maxlength="256" size="55" name="q" value="struts"/>
</form>
<script><!--
document.forms[0].submit();
//--></script>


-----Original Message-----
From: wbchmura@Ensign-BickfordInd.com
[mailto:wbchmura@Ensign-BickfordInd.com]
Sent: Saturday, September 07, 2002 01:41
To: struts-user@jakarta.apache.org
Subject: RE: [OT] JavaScript auto-submit form



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



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

<form name="FormDrillDownReport" method="POST"
action="/twizard/drillDownReport.do">
<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>
</select>


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



-----Original Message-----
From: cbartl03 [mailto:cbartl03@sprintspectrum.com]
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
automatically
submitted?  On page load?  When the user has filled out all the fields?

> -----Original Message-----
> From: Eddie Bush [mailto:ekbush@swbell.net]
> 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:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
>

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>




--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message