im trying to create a javascript classroom validator that checks if the user enters a valid classroom number.
Rules: Must be 4 digits Must be in the format of: 2 Capital Leters followed by 2 digits
What i have so far. this only checks for the length. im not sure how to go about doing the other validator.
function classRoom_validate(CLASS, max)
{
var CLASS_len = CLASS.value.length;
if (CLASS_len != max && CLASS.value.match()
{
alert("Invalid classroom");
CLASS.focus();
return false;
}
return true;
}
homeworktag.