Hello
Me again... 🙂
All in the learning process....
This is what's happening:
A division authority can add a user to their own division, a system authority can add a user to any division.
So far i have the code so that it checks to make sure the entire divisioncode is checked and in the right format.
this is what i have:
function isValidNewDC(field) {
var divcodePat = /(A-V)(\d(4))/;
var matchArray = field.value.match(divcodePat);
if (matchArray == null) {
alert ("Divcode is not in a valid format.\n\ It must begin with a capital letter\n followed by 4 numbers. \n\n Example: A1234, B0001")
field.focus();
field.select();
return false;
}
checkdivcode()
}
I also have the code on how to get the user's division, this gives the beginning letter of the divcode only, not the numbers of that user, so Guy would be A, Alice would be C, ect... and they are adding a user named george in their own division with say a code like A1234 or C1234... so it must check the first letter, make sure it matches their own division ID and then make sure it follows the above pattern match.
What i mean is, the divcode is different then the division ID, and they both use a different table.
So their own division id is known as $user_division_id, and i need to check that with the divcode that is being entered.
and hell i know i'm not making it clear!!!