This sort of field is often known as "formatted" or "validated", depending on whether the checking is done for every keystroke or only when the field is moved out of/submitted.
However, I have almost a personal crusade
against such fields. I absolutely hate fields which limit the input to what the programmer or designer thought might be entered, especially if they are mandatory on the form.
I personally believe that thousands of companies are losing e-commerce sales every day, and probably don't even know about it, all because of needless validation on form fields. About half the on-line forms I see have some form of stupid validation :- either they enforce the US-style 3-3-4 phone numbers, require that I select a "state" from a list (or only allow two characters), only allow numbers in the "zip code" and so on.
Lots of Us-designed forms won't even work for a Canadian customer, let alone one from elsewhere in the world.
Whenever you think about putting formatting or validation on an input field - think twice; No. Think
three times and take a cold
shower. You don't need it. Let the user decide what is a valid address or phone number.
Sorry for the rant.