You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Paul Hodgetts <ph...@agilelogic.com> on 2003/03/17 05:55:43 UTC

Validator Localization

I'm trying to localize validations where I have some fields that
only appear in certain locales, and therefore only need to be
validated under those locales.

Given the following validation.xml (abbreviated a bit - it's
actually a lot larger than this):

<form-validation>
   <formset>
     <form name="infoMailingListForm">
       <field property="contactFName" depends="required">
         <arg0 key="formFieldLabel.contactFName" />
       </field>
     </form>
   </formset>
   <formset language="en" country="UK">
     <form name="infoMailingListForm">
       <field property="mailingListPostcode" depends="required, mask">
         <arg0 key="formFieldLabel.mailingListPostcode"/>
       </field>
     </form>
   </formset>
   <formset language="en" country="US">
     <form name="infoMailingListForm">
       <field property="mailingListZip" depends="required, mask">
         <arg0 key="formFieldLabel.mailingListZip"/>
       </field>
     </form>
   </formset>
</form-validation>

When I set the locale to en_UK or en_US, the Postcode or Zip
fields do not get validated.  The FName field always gets
validated under any locale.  What do I need to do to set up
for and trigger the locale-specific validation to happen?

Thanks much,
Paul
-----
Paul Hodgetts -- Principal Consultant
Agile Logic  -- www.agilelogic.com
Consulting, Coaching, Training -- On-Site & Out-Sourced Development
Java, J2EE, C++, OOA/D -- Agile Methods/XP/Scrum, Use Cases, UI/IA