Well, I am not sure about the JS in struts yet, but you do not submit a document, you 
submit a form.

If there is only 1 form on the page, try 'onChange="forms[0].submit()" '

but, also try to add 'onChange="submitMyForm(this)" '
and add a function at the top of this page called "submitMyForm()" and then submit the 
form then.

-----Original Message-----
From: Oliver Reflé [mailto:[EMAIL PROTECTED]
Sent: Friday, April 04, 2003 8:46 AM
To: Struts
Subject: javascript and Struts


Hi Guys,
i have a strange problem. Maybe you can help me. I would like to submit a
form when a select box value
has changed.Here is the code like i try it:

<html:form action="/updateCampaign?target=update" method="POST">
<table>
<tr><td><b>Datenfeld</b></td><td><b>Wert</b></td></tr>
<tr><td>Kampagnenname:</td><td>
<html:select property="campaignName" onchange="document.submit()">
    <html:option value=""/>
    <html:options collection="campaignList" property="label"/>
</html:select>
</td></tr>

.......

I also trid javascript:{document.forms[0].submit()} etc. but nothing worked.
When i try this now on
a normal HTML form it works. But with the struts form i get the message.
Method not supported by object.

But i cannot imagine why this happens, cause javascript is executed on
client side and there the code
is the same.

So do you have any idea ??

Thx in advance

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to