I'd like to set a form's action based on the presence of an bean. The code
below fails during compile at the first </logic:present> tag, saying that it
is a mismatch.

---- start snip -----------------------------------
<logic:present name="abcForm">
    <html:form method="post" action="/saveABC">
</logic:present>
<logic:present name="xyzForm">
    <html:form method="post" action="/saveXYZ">
</logic:present>

...

</html:form>
---- stop snip ------------------------------------

My gut feeling is that I would have to nest the whole form block in each
logic block to make this work. ... Right or wrong?

I really don't want to nest the form like that because it would make too
much code duplication. For the time being I've set the form to default to
one option then switch it if needed in a JavaScript function. That works but
seems ugly. Is there a better option?

Thanks,
boz

Reply via email to