//VALIDATE REQUIRED FIELDS function errorChecking() { // CHECK TO SEE IS LAST NAME IS VALID if (document.question_form.lname.value =="" || document.question_form.lname.value ==null || document.question_form.lname.value.charAt(0) == ' ' || !isNaN(document.question_form.lname.value)) {window.alert("Please enter your last name."); document.question_form.lname.focus(); return false;} // CHECK TO SEE IF FIRST NAME IS VALID else if (document.question_form.fname.value == "" || document.question_form.fname.value ==null || document.question_form.fname.value.charAt(0) == ' ' || !isNaN(document.question_form.fname.value)) {window.alert("Please enter your first name."); document.question_form.fname.focus(); return false;} // CHECK PHONE NUMBER IS VALID else if (document.question_form.home_phone.value != "" && document.question_form.home_phone.value.search(/\d{3}\-\d{3}\-\d{4}/)==-1) {window.alert("The home phone number you entered is not valid.\r\nPlease enter the phone number in the xxx-xxx-xxxx format.\r\nArea code is required."); document.question_form.home_phone.focus(); return false;} else if (document.question_form.work_phone.value != "" && document.question_form.work_phone.value.search(/\d{3}\-\d{3}\-\d{4}/)==-1) {window.alert("The work phone number you entered is not valid.\r\nPlease enter the phone number in the xxx-xxx-xxxx format.\r\nArea code is required."); document.question_form.work_phone.focus(); return false;} else if (document.question_form.cell_phone.value != "" && document.question_form.cell_phone.value.search(/\d{3}\-\d{3}\-\d{4}/)==-1) {window.alert("The cell phone number you entered is not valid.\r\nPlease enter the phone number in the xxx-xxx-xxxx format.\r\nArea code is required."); document.question_form.cell_phone.focus(); return false;} else if (document.question_form.home_phone.value == "" && document.question_form.work_phone.value == "" && document.question_form.cell_phone.value == "") {window.alert("Please enter either your home phone, work phone, or cell phone number."); document.question_form.home_phone.focus(); return false;} // CHECK TO SEE IF EMAIL IS VALID else if (document.question_form.email.value =="" || document.question_form.email.value ==null || document.question_form.email.value.charAt(0) == ' ') {window.alert("Please enter your email address."); document.question_form.email.focus(); return false;} var apos=document.question_form.email.value.indexOf("@") var dotpos=document.question_form.email.value.lastIndexOf(".") if (document.question_form.email.value == "" || apos<1 || dotpos-apos<2) {window.alert("Email address is not valid. Please try again."); document.question_form.email.focus(); return false;} else if (document.question_form.libcardnum.value == "" || document.question_form.libcardnum.value == null || document.question_form.libcardnum.value.charAt(0) == ' ') {window.alert("Please enter your library card number."); document.question_form.libcardnum.focus(); return false;} else if (document.question_form.libcardnum.value.length < 14) {window.alert("Please enter a valid library card number."); document.question_form.libcardnum.focus(); return false;} // CHECK TO SEE IF A LOCATION WAS SELECTED else if (document.question_form.location.value == "select") {window.alert("Please select the location."); document.question_form.location.focus(); return false;} else if (document.question_form.question.value == "" || document.question_form.question.value == null || document.question_form.question.value.charAt(0) == ' ') {window.alert("Please enter a comment or question."); document.question_form.question.focus(); return false;} return true; }

Library Account Questions


Library Catalog
Have a question about your account, holds, fines or an item? Ask it here!


Get Help Now!

Complete This Form