views:

146

answers:

2

I wish to use anchors instead of submit button in a struts tag form. Can I do it ? How should i create it ?

please help

A: 

For anchor using struts tag use this

<s:url id="url" action="dummyAction">
     <s:param name="parameterName"><s:property value="parameterValue"/></s:param>
</s:url>
<s:a href="%{url}">Click here</s:a>
Vinayak.B
will the form parameters be forwarded to the bean properties properly ? I have some textfields in the form. I want their values to enter the bean properties when user clicks the anchor
lakshmanan
Take the help of javascript and populate the <s:param/>'s before clicking the link.. in this way u can sumbit the user input form.
Vinayak.B
Take the help of javascript and populate the <s:param/>'s before clicking the link.. in this way u can sumbit the user input form. ORIf you want to submit the form using anchor the Call the javascript function onclick of the anchor and use document.forms["myform"].submit(); in the function.
Vinayak.B
A: 

I'd suggest just doing a javascript:form.submit() inside your anchor tag href

Tyler