You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brian McSweeney <br...@aurium.net> on 2003/10/02 12:57:33 UTC

Use Validator for two actions on same jsp

Hi all,

Didn't really get any clear response on this before. 

Is it possible to validate two actions from one jsp using the validator.
This is easiest to explain with a short bit of code:


<html:form action="/action1.do" onsubmit="return
validateAction1Form(this)" method="post">     
<table width="100%">
    <tr>
        <td><label for="email"><fmt:message
key="label.email"/>:</label></td>
        <td>
        	<html:text property="email" size="25"/>
        </td>
    </tr>
       <tr>
		<td>
			<INPUT type=SUBMIT value="submit">
		</td>
       </tr>
</table>
</html:form>


<html:form action="/action2.do" onsubmit="return
validateAction2Form(this)" method="post">     
<table width="100%">
    <tr>
        <td><label for="creditcard"><fmt:message
key="label.creditcard"/>:</label></td>
        <td>
        	<html:text property="creditcard" size="25"/>
        </td>
    </tr>
       <tr>
		<td>
			<INPUT type=SUBMIT value="submit">
		</td>
       </tr>
</table>
</html:form>

Now normally I'd just put in

<html:javascript formName="action1Form">

to validate the first form. But I wonder can I validate the two from the
same page depending on which button gets pressed?

If this is impossible, then I'd like to add it as a feature request.

Cheers,
Brian



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org