This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I would like to have multiple "html:form" in my JSP but it doesn't seems to work... Is there any restrictions?
I prefered to have multiple forms because I use the Validator framework and use the Client Side JS validation. If I have only one form (and use a DispatchAction), the JS is not valid anymore...My validations are depending on the button pressed.
I don't see anywhere where it states that there's a restriction of the number of html:forms per JSP, it certainly doesn't make any sense to have such a restriction...
Besides, I have several JSPs with multiple html:forms.
I can say that you can only have one html:form per html:form though, in other words: no nesting. (you can do it, but submitting the nested form will cause the outer form to submit, so the whole construct is always submitted and always goes to the same action)
Ok, so Ray says you can have multiple html:forms on the page.
Does it work when you aren't using the JS validation, Rick?
Joined: Aug 08, 2003
On rereading my post I note it comes across a bit strong, that wasn't the intent...apologies for any unintended snubbing.
I haven't used js validation, but I have used regular validation, which seems to work just fine despite multiple forms. Each validation definition is tied to a specific ActionForm, and only one form is submitted at a time, so that's not much of a surprise. I would be interested to know how multi js validation works out.