validation.xml

admin

Administrator
Staff member
Hi All,

I've inherited part of a struts project in which a page requests a new user to enter various deatils, two of which are password and confirm password, problem is, when I perform validation on the various inputs, it does not give a validation error when the new and confirm passwords do not match, unless any other field also fails validation....... how do I change the following to make this work....thnx

<form name="frmUserManagement">

<field property="loginName"
depends="taRequiredIfI18n">
<arg0 key="loginName.displayname"/>
<var>
<var-name>field[0]</var-name>
<var-value>invokedBy</var-value>
</var>
<var>
<var-name>fieldTest[0]</var-name>
<var-value>EQUAL</var-value>
</var>
<var>
<var-name>fieldValue[0]</var-name>
<var-value>taWebLabel.addormodify</var-value>
</var>
</field>

<field property="password"
depends="taRequiredIfI18n,taMinlength,taMaxlength,taMask,taMatch">
<arg0 key="newPassword.displayname"/>
<arg1 key="username.minlength.displayname"/>
<arg2 key="username.maxlength.displayname"/>
<arg3 key="passwords.displayname"/>
<var>
<var-name>field[0]</var-name>
<var-value>invokedBy</var-value>
</var>
<var>
<var-name>fieldTest[0]</var-name>
<var-value>EQUAL</var-value>
</var>
<var>
<var-name>fieldValue[0]</var-name>
<var-value>taWebLabel.addormodify</var-value>
</var>
<var>
<var-name>minlength</var-name>
<var-value>3</var-value>
</var>
<var>
<var-name>maxlength</var-name>
<var-value>14</var-value>
</var>
<var>
<var-name>mask</var-name>
<var-value>^[0-9a-zA-Z_]*$</var-value>
</var>
<var>
<var-name>secondProperty</var-name>
<var-value>password2</var-value>
</var>
</field>

<field property="password2"
depends="taRequiredIfI18n,taMatch">
<arg0 key="confirmPassword.displayname"/>
<var>
<var-name>field[0]</var-name>
<var-value>invokedBy</var-value>
</var>
<var>
<var-name>fieldTest[0]</var-name>
<var-value>EQUAL</var-value>
</var>
<var>
<var-name>fieldValue[0]</var-name>
<var-value>taWebLabel.addormodify</var-value>
</var>
</field>


<field property="contact"
depends="taRequiredIfI18n,taEmail">
<arg0 key="contact.displayname"/>
<var>
<var-name>field[0]</var-name>
<var-value>invokedBy</var-value>
</var>
<var>
<var-name>fieldTest[0]</var-name>
<var-value>EQUAL</var-value>
</var>
<var>
<var-name>fieldValue[0]</var-name>
<var-value>taWebLabel.addormodify</var-value>
</var>
</field>
</form>
 
Back
Top