struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Reumann <maill...@reumann.net>
Subject Re: [VALIDATOR] Validating Date with DynaValidator
Date Wed, 04 Sep 2002 04:45:46 GMT
On Tuesday, September 3, 2002, 5:45:57 PM, Axel Stahlhut wrote:


AS> This is my validation-rules.xml:

AS>       <validator name="date"
AS>             classname="org.apache.struts.util.StrutsValidator"
AS>                method="validateDate"
AS>          methodParams="java.lang.Object,
AS>                        org.apache.commons.validator.ValidatorAction,
AS>                        org.apache.commons.validator.Field,
AS>                        org.apache.struts.action.ActionErrors,
AS>                        javax.servlet.http.HttpServletRequest"
AS>                        msg="errors.date"
AS>                        jsFunctionName="DateValidations">

AS> and the validation.xml:

AS> <field property="beginEmployment" depends="date">
AS> <arg0 key="personal.data.beginEmployment" />
AS> <var>
AS> <var-name>datePattern</var-name>
AS> <var-value>dd.MM.yyyy</var-value>
AS> </var>
AS> </field>

    I think you need the depends="required" in the validation-rules
    for date. You don't want it in the validation.xml but in the rule
    I think you might need it to get it to work correctly. I have the
    depends="required" in the validation-rules.xml for date and my
    dates are getting validated if I leave the field blank, so give it
    a try. Not positive that's the problem though.

--

Rick

mailto:maillist@reumann.net


--
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