struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michelle Harris <michelle.har...@travelocity.com>
Subject 2nd field doesn't validate, first one does
Date Thu, 02 Jan 2003 19:42:22 GMT
Hi all,

I've been trying to get data validation working. Many thanks for earlier 
responses.

I did get a sample login app up and running. However, the oddest thing 
happens. The first field, username, validates correctly. However, the 
second one, password, doesn't validate at all. I'm including my 
validation.xml file -- hoping I have an error.

Any advice would be much appreciated.

Many thanks,
Michelle

----


<form-validation>
    <global>
       <constant name="phone" value="^\(?(\d{3})\)?[-| ]?(\d{3})[-| 
]?(\d{4})$" />
       <constant name="zip" value="^\d{5}\d*$" />
    </global>
    <formset>
       <constant name="zip" value="^\d{5}(-\d{4})?$" />

       <form    name="loginForm">
          <field    property="username"
                    depends="required,mask,minlength">
                      <arg0 key="loginForm.username.displayname"/>
                      <arg1 name="minlength" key="${var:minlength}" 
resource="false"/>
                      <var>
                        <var-name>mask</var-name>
                        <var-value>^\w+$</var-value>
                      </var>
                      <var>
                        <var-name>minlength</var-name>
                        <var-value>5</var-value>
                      </var>
          </field>
          <field    property="password"
                    depends="required,mask,maxlength">
                      <msg name="mask" key="loginForm.password.maskmsg"/>
                      <arg0 key="loginForm.password.displayname"/>
                      <arg1 name="maxlength" key="${var:maxlength}" 
resource="false"/>
                      <var>
                        <var-name>mask</var-name>
                        <var-value>^[a-zA-Z]*$</var-value>
                      </var>
                      <var>
                        <var-name>maxlength</var-name>
                        <var-value>8</var-value>
                      </var>
          </field>
       </form>
    </formset>
</form-validation>


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


Mime
View raw message