We need to validate a field called: Clave de elector. This field will be used in a site of Mexico.
You must create a rule to prevent the user to input any numbers and letters to fill in the form of the site. It is not necessary to check any information, just create a script that identifies the number the user entered is not any number.
Definition (Mexico Language):
Clave de elector. Esta clave se forma por las consonantes iniciales de los apellidos y el nombre del elector, también contiene su fecha de nacimiento iniciando por el año, la entidad federativa de nacimiento (en el caso de Campeche es el número 04 por ejemplo), si es hombre o mujer y una clave sobre la ocupación que se tenía en el momento de su inscripción.
How does work:
18 characters
Example:
Name: Sandra Isela
Last Name: Castillo
Mother’s maiden name: Hernandez
Birthday:14 septiembre 1970
Place of Place: DF
Gender: Mujer
Clave de elector: CSHRSN70091409M300
C: First letter of the person’s last name
S: First consonant of the person’s last name
H: First letter of the person’s mother’s maiden name.
R: First consonant of the person’s mother’s maiden name.
S: First letter of the person’s name.
N: First consonant of the person’s name.
70: Year of birth
09: Month of birth
14: Date of birth
09: Federal Entity
M: Gender
300: Check Digit
This code will be incorporated in a registration form in php.