I have a JSP with two forms, and they both need to go to the same 
action. But Struts assumes that the "name" property of the HTML form 
(e.g. <FORM NAME="MYFORM">) should be the same as the name of the 
associated form bean. As a result, I can't use JavaScript to refer to 
one of the forms, since they both have the same name.

Is this a situation where I need to write my own version of <html:form>? 
Why does Struts make this assumption?

Things I've already considered:

- Using two different actions with different form beans. This doesn't 
work, since the JSP needs to refer to the form bean by name (for 
example, in <bean:write>). If I use two actions that return the same 
JSP, they need to use the same form bean.

- Combining the two forms into one. This doesn't work in my situation, 
since the forms need to submit different values for the same fields.

- Referring to the forms by number in my JavaScript (e.g. 
document.forms[0]). This doesn't work, since there may be other forms on 
the page, which would throw off the numbering.

Any ideas?
Thanks,
Jacob


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

Reply via email to