You can't in HTML alone. You would have to use JavaScript.
Yeah, you can use the drop down list approach. I really REALLY hate it when developers go that route. I know WHY they do it, but it really makes for a crappy user interface.
The one that really irks me is State. I can type NY in about 3 nanoseconds. To pick NY from a dropdown takes 5+ seconds (even if you use the keyboard, because you have to type N 4 times to get to NY).
Learn some javascript and validate that way.
Yeah, you can use the drop down list approach. I really REALLY hate it when developers go that route. I know WHY they do it, but it really makes for a crappy user interface.
The one that really irks me is State. I can type NY in about 3 nanoseconds. To pick NY from a dropdown takes 5+ seconds (even if you use the keyboard, because you have to type N 4 times to get to NY).
Learn some javascript and validate that way.