You could either edit the validator function to include a new 'type' of field to check for, say, called 'us_state' (so you could explicitly check that the two alpha chars entered are in your list of 'valid' states), or more simplistically you could just do what you're doing above, require the user enters exactly 2 alpha chars, and then just use the strtoupper() function to make sure the chars are in upper case - although that doesn't stop someone from entering a string that isn't actually a state!
To do it 'properly', in the 'valid_states' case, first of all reject the input if it's not 2 uppercase alpha chars (or you could just accept 2 alpha chars and do the conversion yourself with strtoupper()). If that check goes through ok, nextcreate an array of states like:
$valid_states=array(
"NY",
"MA",
"VA",
//... etc, no idea if the above are actually US states, sound vaguely like it!
);
then use the in_array() function to test if the input the user submitted is in the $valid_states array. If the input is in the array, accept it and process it/put it in db or w/e... if not, reject the input and tell the user why it's not valid input ('the input you gave is not a valid state etc').
Hope that makes sense!