struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brice Ruth <br...@fiskars.com>
Subject Re: Form submission through java script
Date Mon, 10 Nov 2003 22:36:01 GMT
Why are you setting the document.form.action? Just call 
document.form.submit() - the JavaScript will automatically know what to 
do and where to submit to.

Shishir K. Singh wrote:

>Hi, 
>
>I have a form with one drop down menu list and two buttons (continue and
>previous ). The two buttons are hooked up to the LookupDispatchAction
>where 
>I process the code as required by the action of the button. Everything
>works fine if I use the buttons. 
>
>
>My requirement is that when I click on any one value of the list box,
>the form should get submitted. I am trying to use Javascript to do the
>same. 
>
>In the onclick of the select html:select, I have a function called
>submit() 
>
>The submit function looks like this
>
>
>
><script language="text/javascript">
>    function submit() {
>        document.form.action =
>http://localhost:8081/createContentAction.do
>        document.form.submit()
>    }
>
></script> 
>
> 
>And my form action is 
>
>
><html:form  action="/createContentAction">
>
>
>
>
>
>When I click any value in the drop down, I get this error :
>
>
>javax.servlet.ServletException: Request[/createContentAction] does not
>contain handler parameter named action
>	at
>org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct
>ion.java:199)
>	at
>org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
>ocessor.java:484)
>	at
>org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
>274)
>	at
>org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>	at
>org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>	at
>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
>tionFilterChain.java:247)
>	at
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
>erChain.java:193)
>	at
>org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFi
>lter.java:226)
>	at
>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
>tionFilterChain.java:213)
>	at
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
>erChain.java:193)
>	at
>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
>e.java:243)
>	at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
>va:566)
>	at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
>72)
>	at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>	at
>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
>e.java:190)
>
>
>Can anyone pls tell me where am I going wrong or what more needs to be
>done ??
>
>TIA
>Shishir
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>  
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



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


Mime
View raw message