<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
<!--
	Descriptions: This file contains specific validation rules for a comms module
	History: Created on 10/20/22/2004	(DNS   lev)
-->
<form-validation>
    <formset>
        <form name="undeliverableMailSearchForm">
            <field property="caseNumber" depends="integer">
                <arg0 key="label.comms.caseNumber"/>
            </field>
            <field property="dateMailed" depends="date">
                <arg0 key="label.comms.dateMailed"/>
            </field>
        </form>

        <form name="undeliverableMailEditAddressForm">
            <field property="addressLine1" depends="required,minlength,maxlength">
                <arg0 key="label.addresses.addressLine1"/>
                <arg1 name="minlength" key="${var:minlength}" resource="false"/>
                <arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
                <var>
                    <var-name>minlength</var-name>
                    <var-value>3</var-value>
                </var>
                <var>
                    <var-name>maxlength</var-name>
                    <var-value>35</var-value>
                </var>
            </field>
            <field property="addressLine2" depends="minlength,maxlength">
                <arg0 key="label.addresses.addressLine2"/>
                <arg1 name="minlength" key="${var:minlength}" resource="false"/>
                <arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
                <var>
                    <var-name>minlength</var-name>
                    <var-value>3</var-value>
                </var>
                <var>
                    <var-name>maxlength</var-name>
                    <var-value>35</var-value>
                </var>
            </field>
            <field property="addressLine3" depends="minlength,maxlength">
                <arg0 key="label.addresses.addressLine3"/>
                <arg1 name="minlength" key="${var:minlength}" resource="false"/>
                <arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
                <var>
                    <var-name>minlength</var-name>
                    <var-value>3</var-value>
                </var>
                <var>
                    <var-name>maxlength</var-name>
                    <var-value>35</var-value>
                </var>
            </field>
            <field property="city" depends="required,minlength,maxlength">
                <arg0 key="label.addresses.city"/>
                <arg1 name="minlength" key="${var:minlength}" resource="false"/>
                <arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
                <var>
                    <var-name>minlength</var-name>
                    <var-value>2</var-value>
                </var>
                <var>
                    <var-name>maxlength</var-name>
                    <var-value>15</var-value>
                </var>
            </field>
            <field property="state" depends="required,minlength,maxlength">
                <arg0 key="label.addresses.state"/>
                <arg1 name="minlength" key="${var:minlength}" resource="false"/>
                <arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
                <var>
                    <var-name>minlength</var-name>
                    <var-value>2</var-value>
                </var>
                <var>
                    <var-name>maxlength</var-name>
                    <var-value>40</var-value>
                </var>
            </field>
            <field property="zipCode" depends="required,validwhen,integer">
                <msg name="validwhen" key="errors.not.exact.length"/>
                <arg0 key="label.addresses.zipCode"/>
                <arg1 name="validwhen" key="${var:fixedlength}" resource="false"/>
                <var>
                    <var-name>test</var-name>
                    <var-value>((zipCodeLength == 5) or (*this* == null))</var-value>
                </var>
                <var>
                    <var-name>fixedlength</var-name>
                    <var-value>5</var-value>
                </var>
            </field>
            <field property="zipPlus4" depends="validwhen,integer">
                <msg name="validwhen" key="errors.not.exact.length"/>
                <arg0 key="label.addresses.zipPlus4"/>
                <arg1 name="validwhen" key="${var:fixedlength}" resource="false"/>
                <var>
                    <var-name>test</var-name>
                    <var-value>((zipPlus4Length == 4) or (*this* == null))</var-value>
                </var>
                <var>
                    <var-name>fixedlength</var-name>
                    <var-value>4</var-value>
                </var>
            </field>
            <field property="county" depends="minlength,maxlength">
                <arg0 key="label.addresses.county"/>
                <arg1 name="minlength" key="${var:minlength}" resource="false"/>
                <arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
                <var>
                    <var-name>minlength</var-name>
                    <var-value>2</var-value>
                </var>
                <var>
                    <var-name>maxlength</var-name>
                    <var-value>50</var-value>
                </var>
            </field>
            <field property="country" depends="required">
                <arg0 key="label.addresses.country"/>
            </field>
            <field property="province" depends="maxlength">
                <arg0 key="label.addresses.province"/>
                <arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
                <var>
                    <var-name>maxlength</var-name>
                    <var-value>20</var-value>
                </var>
            </field>
            <field property="postalCode" depends="maxlength">
                <arg0 key="label.addresses.postalCode"/>
                <arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
                <var>
                    <var-name>maxlength</var-name>
                    <var-value>10</var-value>
                </var>
            </field>
        </form>

       <form name="deliveryPreferencesForm">
            <field property="emailAddress" depends="email">
            	<arg0 key="label.comms.emailAddress"/>
            </field>
       </form>

    </formset>
</form-validation>