You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Kalra, Ashwani" <ak...@capgemini.com> on 2005/11/25 13:03:06 UTC
Strategy for javascript validation with i18n
Hi all,
In my multilingual project, I want to use my own custom Javascript
validation instead of one provided by strusts 1.1
I have to do this because its not working in many cases with weblogic
workshop, specially the indexed fields.
My main concern is How can I provide a simple java script API which
should take care
1. Getting the message from resource bundle
2. Substituting the message parameters
3. Doing different validation for different countries for the same
field. For eg dd/mm/yyyy for UK, but mm/dd/yyyy for US
1 and 2 can be done with I18n tag, but 3rd is looking to be difficult
as I want to use the common javascript method.
Any have similar experience, please share with me.
__________________
Thanks
Ashwani Kalra
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
Re: Strategy for javascript validation with i18n
Posted by Laurie Harper <la...@holoweb.net>.
Kalra, Ashwani wrote:
> Hi all,
> In my multilingual project, I want to use my own custom Javascript
> validation instead of one provided by strusts 1.1
> I have to do this because its not working in many cases with weblogic
> workshop, specially the indexed fields.
>
> My main concern is How can I provide a simple java script API which
> should take care
> 1. Getting the message from resource bundle
> 2. Substituting the message parameters
> 3. Doing different validation for different countries for the same
> field. For eg dd/mm/yyyy for UK, but mm/dd/yyyy for US
>
> 1 and 2 can be done with I18n tag, but 3rd is looking to be difficult
> as I want to use the common javascript method.
>
> Any have similar experience, please share with me.
You might find it less work to figure out how to use validator correctly
rather than re-writing the functionality from scratch. One point you may
not be aware of is that validator does, in fact, already support
locale-specific validation rules. In other words, your case 3 above is
already supported by validator (as are cases 1 and 2). You just need to
define separate validation rules for each locale you want to support in
validation.xml.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Strategy for javascript validation with i18n
Posted by abdurrahman sahin <ab...@argela.com.tr>.
hi;
in our project. I defined a User class that holds cultural information, date
format, number patterns, etc,
application starts up with a given default user. When a user logons to the
system, the user interface guis is repainted regarding that logged user's
cultural info.
-----Original Message-----
From: Kalra, Ashwani [mailto:akalra@capgemini.com]
Sent: Friday, November 25, 2005 2:03 PM
To: user@struts.apache.org
Subject: Strategy for javascript validation with i18n
Hi all,
In my multilingual project, I want to use my own custom Javascript
validation instead of one provided by strusts 1.1
I have to do this because its not working in many cases with weblogic
workshop, specially the indexed fields.
My main concern is How can I provide a simple java script API which
should take care
1. Getting the message from resource bundle
2. Substituting the message parameters
3. Doing different validation for different countries for the same
field. For eg dd/mm/yyyy for UK, but mm/dd/yyyy for US
1 and 2 can be done with I18n tag, but 3rd is looking to be difficult
as I want to use the common javascript method.
Any have similar experience, please share with me.
__________________
Thanks
Ashwani Kalra
This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate, distribute, or use
this message or any part thereof. If you receive this message in error,
please notify the sender immediately and delete all copies of this message.