
// subject - 2-10 chars, uc, lc, and underscore only.

function checkSubject (strng) {
    var error = "";

    if (strng == "") {
       error = "Please enter a subject.\n";
       return error;
    }

alert(illegalChars.test(strng));
    var illegalChars = /\W/; // allow letters, numbers, and underscores
    if (strng.length < 2) {
       error = "The subject is not long enough.\n";
    }
    else if (illegalChars.test(strng)) {
       error = "The subject contains illegal characters.\n";
    } 
    return error;
}
