Is your form derived from ValidatorForm rather than ActionForm?
----- Original Message -----
From: "Clayson, Jim" <[EMAIL PROTECTED]>
> Hi I am attempting to use the date validation provided by the framework -
I
> am using struts1.1b2.
>
> I think I must be missing something fairly fundamental but maybe someone
> will be able to confirm what that is. The problem is when I enter garbage
> into the form's date fields and submit them, I get no errors. How does one
> usually display the errors when using the validator framework.
>
> I have my validator-rules.xml and validation.xml config files in my
> application's web-inf dir.
>
> Their relevent contents are as follows:
>
> validator-rules.xml
>
> <validator name="date"
> classname="org.apache.struts.util.StrutsValidator"
> method="validateDate"
> methodParams="java.lang.Object,
> org.apache.commons.validator.ValidatorAction,
> org.apache.commons.validator.Field,
> org.apache.struts.action.ActionErrors,
> javax.servlet.http.HttpServletRequest"
> depends="required"
> msg="errors.date"
> jsFunctionName="DateValidations">
>
> <javascript><![CDATA[
> function validateDate(form) {
> ....... etc
>
> return true;
> }]]>
> </javascript>
>
> </validator>
>
> and validation.xml:
>
> <formset>
> <form name="ReportForm">
> <field property="dateFrom" depends="date">
> <arg0 key="ReportForm.dateFrom"/>
> </field>
> <field property="dateTo" depends="date">
> <arg0 key="ReportForm.dateTo"/>
> </field>
> </form>
> </formset>
>
> I have my action's validate attribute set to "true".
>
> Are the above setup correctly?
>
> Thanks
> Jim
--
To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>