thank you for your responce.

 

I tried the below to pass parameters and also to submit the form.

 

    

<jsp:useBean id="mapParams" class="java.util.HashMap"/>
<c:set target="${mapParams}" property="theKey" value="${theValue}"/>
<c:set target="${mapParams}" property="theKey1" value="${theValue1}"/>


<html:link href="javascript:document.myform.submit()" name="mapParams" >
<c:out value="${custItr.empName}"/>
</html:link>   

 

When i click on the link getting javascript error which says "syntax error". 
when I remove the "name" attribute in <html:link> there is no error but I need 
to have the name attribute to pass the parameters. 

How to do both the submit and passing of parameters using <html:link>? Your 
help is appreciated.

 

Thanks.
 
> Subject: RE: html:link submit with request parameters
> Date: Fri, 13 Nov 2009 14:44:55 -0500
> From: david_kawczyn...@merck.com
> To: user@struts.apache.org
> 
> Use javascript to get a reference to the form, and call its submit 
> method. 
> 
> EG
> <form name="form" id="form" action="/setup.do">
> <input name="blah" />
> <input type="submit"/>
> </form>
> <script>
> function submit() {
> document.getElementById("form").submit() return false;
> }
> </script>
> <a href="javascript:submit();" 
> onclick="return submit();">click me</a>
> 
> 
> 
> 
> 
> 
> > -----Original Message-----
> > From: fea jabi [mailto:zy...@hotmail.com] 
> > Sent: Thursday, November 12, 2009 8:43 PM
> > To: user@struts.apache.org
> > Subject: html:link submit with request parameters
> > 
> > 
> > I need to submit the form when the <html:link ..... > is 
> > clicked/pressed and also need to pass parameters. 
> > 
> > 
> > 
> > <c:url value="/setup.do" var="setupUrl">
> > 
> > <c:param name="empId" value="${custItr.empId}"/>
> > 
> > </c:url>
> > 
> > <html:link href="<%= 
> > (String)pageContext.getAttribute(\"setupUrl\") %>" 
> > transaction="true" >
> > 
> > <c:out value="${custItr.empName}"/>
> > 
> > </html:link>
> > 
> > 
> > 
> > but this is not submitting the form. How can I submit the 
> > form and also pass the request params? Basically I want other 
> > values entered in the html form are set to the form bean so i 
> > can acess those in action class when the link is pressed.
> > 
> > 
> > 
> > How can this be done?
> > 
> > 
> > 
> > Thanks.
> > 
> > _________________________________________________________________
> > Hotmail: Trusted email with Microsoft's powerful SPAM protection.
> > http://clk.atdmt.com/GBL/go/177141664/direct/01/
> > http://clk.atdmt.com/GBL/go/177141664/direct/01/
> > 
> Notice: This e-mail message, together with any attachments, contains 
> information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New 
> Jersey, USA 08889), and/or its affiliates Direct contact information for 
> affiliates is available at http://www.merck.com/contact/contacts.html) that 
> may be confidential, proprietary copyrighted and/or legally privileged. It is 
> intended solely for the use of the individual or entity named on this 
> message. If you are not the intended recipient, and have received this 
> message in error, please notify us immediately by reply e-mail and then 
> delete it from your system.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
                                          
_________________________________________________________________
Windows 7: It works the way you want. Learn more.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen:112009v2

Reply via email to