// Master value validator routine function isValid(inputStr) { if (isEmpty(inputStr)) { alert("Please enter a number into the field before clicking the button.") return false } else { if (!isNumber(inputStr)) { alert("Please make sure entries are numbers only.") return false } else { if (!inRange(inputStr)) { alert("Sorry, the number you entered is not part of our database. Try another three-digit number.") return false } } } return true }