RegularExpressionValidator and Int'l characters

T

Tomasz J

Hello Developers,

Is there any easy way of validating user input, like last name, using
RegularExpressionValidator which would allow for international characters?

Apprently ValidationExpression="^[\w\s']+$" is not the right way to do it.

Thank you for any hints.

Tomasz J
 
P

PJ on Development

Hello, Tomasz

Apparently your RegEx expression is a bit weird. For what I can gather
you want to accept letters, space and a single quote char ('). Am I
right?

So I think that a RexEx expression like "^((\w|')+\s+?)$" (without the
outer quotes) should do the trick.

However the validation needs to be done on the server (and making sure
that the Cuture of the page is set) because the JavaScript does not
handle internationalization very well.

Regards,

Paulo Santos
http://pjondevelopment.50webs.com
 
T

Tomasz J

I am not sure why you said my expression is weird - it looks fine to me.
But it is a very good point! I probably should set
EnableClientScript="false".

Thank you.

Tomasz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top