I got this from a website for South Africa about gender and identity number: there are 13 characters in total
If 7th character (from left) of the string(ID) is between 0 and 4 the person is female, and between 5 and 9 that person is male .
How can i get this in a txtbox of a form.
Table = cyclist
form = CyclistF
Identity number field = IdNo (where identity number is captured)
gender txtbox = gendertype (where it must state male or female depending on 7th digit of identity number in IDNo field
I also have a field called "Gender" in this table if it can be used or i will copy it across from txtbox.
pls help
they had this code on the website
If 7th character (from left) of the string(ID) is between 0 and 4 the person is female, and between 5 and 9 that person is male .
How can i get this in a txtbox of a form.
Table = cyclist
form = CyclistF
Identity number field = IdNo (where identity number is captured)
gender txtbox = gendertype (where it must state male or female depending on 7th digit of identity number in IDNo field
I also have a field called "Gender" in this table if it can be used or i will copy it across from txtbox.
pls help
they had this code on the website
Code:
function check_gender_and_id($gender,$idnumber)
{
if (($gender == "male" && $idnumber[6] >= 5 && $idnumber[6] <= 9) || ($gender="female" && $idnumber[6] >= 0 && $idnumber[6] <= 4))
{
return true;
}
return false;
}
Comment