The following code works great if it’s mandatory. Everything I have tried to get it to work as a non-mandatory field, locks the form it’s in. Any suggestions?
$state = check_input($_POST[‘inputState’], “Please enter your State”);
$state = strtoupper($state);
/* If state has non alphabetical characters show error message */
if (!preg_match("/^[a-zA-Z]{2}$/", $state)) {
show_error(“State abbreviation must have two Alphabetical Characters, only.”);
}
Thanks for the help,
honey