Page 1 of 1

Is it really a name?

Posted: Thu Feb 10, 2005 9:48 pm
by hawleyjr
OK, I'm doing some form validation and I would like to determine whether or not what the user entered is really their name.

I'm validating against the following:

no numeric characters
no special characters (except for ' and - (hypen) )
A-z is OK
letters such as Éáöň need to be allowed.

I'm stuck on letters that have accents and such on them. anyone?

Posted: Thu Feb 10, 2005 10:28 pm
by feyd
you may need to check if the submitted data is already in html entity form, as I think (depending on page charset settings) Firefox will entity encode the characters, while IE may not.. I can't remember those details. Anyway, you may be able to check the binary for the extended ascii accent characters and/or use a regex to check against all standardized entities for the accented characters (would need to do the numeric, both unicode and charset specific, and letter combo forms)

it's a party...

Posted: Thu Feb 10, 2005 10:32 pm
by hawleyjr
lol, that was the response I didn't want...I'm thinking the easy way out of this is too just check for characters such as: !@#$%^&*(){}[]\|:;?/><,

agree?

Posted: Thu Feb 10, 2005 10:51 pm
by feyd
it can get quite complicated when you want support for international names ;)