Use the validWhen validator for the password and the passwordCheck
fields: http://struts.apache.org/1.2.x/userGuide/dev_validator.html
You'll need to add the passwordCheck field to your registerForm.

I've found these links useful when investigating commons-validator:

*       commons validator examples:
http://wiki.apache.org/jakarta-commons/ValidatorExamples
*       Struts and commons-validator tutorial:
http://struts.apache.org/1.1/userGuide/dev_validator.html
*       Struts validation framework tutorial:
http://www.onjava.com/pub/a/onjava/2002/12/11/jakartastruts.html
*       Oracle article on Struts validation framework:
http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html
*       Very simple Struts validation example:
http://wiki.apache.org/struts/StrutsBeginnerValidatorFramework?highlight
=%28validator%29
*       Helpful Struts validation site:
http://www.niallp.pwp.blueyonder.co.uk/
*       Validation of lists:
http://wiki.apache.org/struts/StrutsCatalogLazyList
*       Useful validator tip for extends:
http://wiki.apache.org/jakarta-commons/ValidatorVersion120

Sean

-----Original Message-----
From: Thomas Thomas [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 07, 2006 3:05 PM
To: Struts Users Mailing List
Subject: Validator FrameWork

 Hi,
I'm using Validator Framework with Struts,
Here I want to validate a registration form.

I want to add a field property passwordCheck, (the user needs to enters
his
password twice : the first password will be in property password, the
second
in passwordCheck)
I want to check if value of password and passwordCheck are the same.
How can I do this ?
Thank u.
Here is my code from now on without the field property passwordCheck :

     <formset>
          <form name="registerForm">
               <field property="login" depends="required">
                  <arg key="required.login"/>
              </field>
              <field property="password" depends="required">
                  <arg key="required.password"/>
              </field>
              <field property="eMail" depends="required">
                  <arg key="required.eMail"/>
              </field>
              <field property="birthYear" depends="required">
                  <arg key="invalid.dateOfBirth"/>
              </field>
              <field property="gender" depends="required">
                  <arg key="invalid.gender"/>
              </field>
          </form>
     </formset>


(In addition to that, I have a lot of difficulties to find information
myself about validator framework, do u have any link for a full
documentation ?)


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

Reply via email to