struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bOOyah <boo...@nowhere.org>
Subject [OT] Javascript event handler: works in Firefox but not Internet Explorer...(?)
Date Tue, 27 Apr 2004 12:47:56 GMT
Hello again

There's probably a better forum for this kind of question; by all means 
point me at it.

I want to submit a form via Javascript whenever the user makes a new 
selection from a drop-down menu.  My Action class is a 
LookupDispatchAction, so I want to emulate the behaviour of a Submit 
button such that the dispatch handler 'ChangeSelection()' in my Action 
is invoked.

Anyhow, the following Javascript + Struts combination works like a dream 
in Firefox (on Windows and Linux) but Internet Explorer barfs at the 
line 'form.action = ..." in the JavaScript below, even when all its 
security settings are dropped to Minimal.  The error IE displays is 
"Error: Object doesn't support this property or method".  And I've tried 
  IE on two different machines.

Any help, as always, will be gratefully received.


The JSP:
=======
<script language="javascript">
function newSelection() {
   form = window.document.myForm;
   form.action = "<html:rewrite page="/my/action/doSomething.do"/>";
   form.submit();
   return false;
}
</script >
...
<html:form action="/editStuff">
   <html:select property="selectedId" onchange="newSelection()" >
     <html:optionsCollection property="myOptions"
                             value="id"
                             label="value"/>
   </html:select>
</form>


The struts-config.xml:
=====================
<action path="/my/action/doSomething"
         parameter="/editStuff.do?action=ChangeSelection"
         type="org.apache.struts.actions.ForwardAction"/>

-- 
bOOyah


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


Mime
View raw message