This has been driving me crazy for about a month now.
I have an hta file that I created for my Job. There is a field called “youruid” which is where the agents have to place their User ID. All User ID’s are in a specific format.
Currently I am using this
function uidcheck()
{
var uidpopup = “Your UID”;
if (youruid.value.length<6) {
youruid.disabled=false
alert (uidpopup + ” is invalid”)
youruid.value=””
document.getElementById(“youruid”).focus();
}
else {
youruid.disabled=true
return false;
document.getElementById(“ban”).focus();
}
}
Its working okay but I really want the field to be validated with a format.
The IDs are in this format aa000[a or 0] two characters (not case sensitive) then either 4 numbers or 3 numbers then another character.
I believe the format is [a-zA-Z]{2}
How can I make the function validate to make sure that it is in this format?