David
From: Paul Hodgetts <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Validator Localization Date: Sun, 16 Mar 2003 17:41:18 -0800
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.
In Struts in Action, Ted talks about adding attributes to the <form> tag. But it looks like under the newer Commons Validator, the localization happens at the <formset> tag.
Given the following validation.xml (abbreviated a bit - it's actually a lot larger than this):
<form-validation> <formset> <form name="infoContactForm"> <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
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]