I'm trying a simple data validation script to ensure that my users are entering the data in the correct fashion.
I have a name text box where the users enter a 2 or 3 character initial. They must add a space inbetween each initial, so:
MJ WAS TY BT ...etc etc etc
They must enter at least one initial and can enter up to 5 initials in all.
I have a script to check the first initial to ensure that it's alright.
if (!eregi("(^[A-Z]{2}[A-Z]?[[:space:]]?$)", $name))
This works as I want it to but how do I add on the optional extra 4 initials that may or may not be added?
Hope this makes sense... thanks for listening
I have a name text box where the users enter a 2 or 3 character initial. They must add a space inbetween each initial, so:
MJ WAS TY BT ...etc etc etc
They must enter at least one initial and can enter up to 5 initials in all.
I have a script to check the first initial to ensure that it's alright.
if (!eregi("(^[A-Z]{2}[A-Z]?[[:space:]]?$)", $name))
This works as I want it to but how do I add on the optional extra 4 initials that may or may not be added?
Hope this makes sense... thanks for listening