Hi Konstantin,
Thanks for the feedback. Right, So many cases to handle in there. I
will also add minimum 2 characters to the list.
Thanks,
Yogesh
Konstantin K wrote:
oh and also allow for . (periods)....
On Mon, Oct 26, 2009 at 4:06 PM, Konstantin
K <kkru...@gmail.com> wrote:
be careful. don't just check if the field is NON empty.
that's not good enough.
in English, you can reasonably assume the following to be true
about names:
- must contain at least 1 letter [A-Za-z]
- may contain ' (apostrephe) and - (dash) and (space)
- shouldn't be longer than 40 characters.
- should not contain #s, or any other symbol, especially <
(so ppl don't start entering html codes, js, etc)
Konstantin
On Mon, Oct 26, 2009 at 3:48 PM, David
Krings <ram...@gmx.net>
wrote:
Yogesh Agashe wrote:
Hello,
This is my first post to this NYPHP mailing list. So hello to everyone
and thanks for the thorough discussions which help a beginner developer
like me.
Welcome, was the same with me, except that I never really left beginner
stage.
> Is there any other way to validate first and last names. It will
be nice
to have have inbuilt function for such commonly used field
types. I will like to know how people tackle these issue.
Thanks.
The only thing I would check is that the fields are not empty. The
maximum length is set via the maxlength parameter in HTML and
everything else qualifies as a valid name. I don't think you can
reasonably script validation to make sure that the first name entered
is "Dirk" and not "Dork".
David
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation
|
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation