Forcing a phone number or zip code to match some regular expression doesn't
really make it valid. The only way to validate that kind of thing is to
interface with an address verification system and that is only available in
relatively few countries.

It's in a users best interest to enter a valid address if they expect you to
send them something. If you aren't sending them something, what do you want
the information for?

My "solution" to a form meant to be used by users in multiple countries
would be to make it as general and accepting as possible. Maybe I would have
a drop-down for US states and then have a "province" field that is only
required if the state is not selected. Users will figure out how to get
their address into the form and the mailman will figure out to deliver it.

If a user wants to enter crap, they can still do it with regular expression
"validation". The purpose of validation should be to catch careless errors.
If it's not worth it to the user to enter valid data, don't expect it to be
valid.

I think it overly complicates things to deal with forms based on a user's
selected locale. I do think formating for display should take into account
the locale.

Hal

> -----Original Message-----
> From: Ted Husted [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 04, 2001 12:13 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Client/Server Side Validation for Struts 1.1
>
>
> We're not only talking just about language now, we're talking about
> validating things like telephone numbers and postal codes based where
> the user is located, regardless of what language they prefer.
> Michael's
> example was a Spanish-speaking resident in the US, who might be in the
> ES locale as to language, but would be in the US location as to
> telephone and postal code. I run into this myself, since we are on the
> Canadian border. We share the same telephone format but
> different postal
> codes. So, during validation we need more granularity than what is
> usually associated with locales.
>
> Perhaps some applications need two "locale" settings, one for language
> preference and another for location, and our validation routines may
> need to be written to recognize that.
>
> Jonathan wrote:
> >
> > I am still confused as to why this is all an issue if the
> user can select
> > the languange of their choice.  If it is an automatic
> thing, like if the
> > server is reading the preferred language strings in the
> header, then maybe
> > you have an issue becuase the Local is not selected by the
> user.  It boils
> > down to what language the user wants to see the pages
> displayed in.  Check
> > out the following sites: www.terra.com www.starmedia.com
> > http://www.dgolpe.com In each case the user SELECTS the
> language of choice.
>

Reply via email to