Zip/Postal code: (Text box)
12345-1234
a. Postal codes such as the US Zip code contain the province/state.
b. Javascript onKeypress code is specified to allow only a dash (ASCII 45) and numbers (ASCII 48-57).
Tabbing away from this field causes invokes a function which looks up its ranges of zip codes in the USA
and automatically selects the state.
c.
Canadian Postal codes are 6 positions like "S3A6V5". The first 3 positions is called the Forward Sortation Area,
with the first letter sequenced from East to West.
The last 3 is the Local Delivery Unit.
d. UK PostCodes contain a space between "CB4 1AS".
US State/ Province:
Please Select
Armed Forces Americas
Armed Forces EMEA+Canada
Armed Forces Pacific
Alaska
Alabama
Alberta, Canada
Arkansas
American Samoa
Arizona
British Columbia, Canada
California
Colorada
Conneticut
District of Colombia
Delaware
Florida
Federated States Micronesia
Georgia
Guam
Hawaii
Iowa
Idaho
Illinois
Indiana
Kansas
Kentucky
Louisiana
Manitoba, Canada
Mariana Islands
Massachusetts
Marshall Islands
Maryland
Maine
Michigan
Minnesota
Missouri
Mississippi
Micronesia (Federated States of)
Montana
New Brunswick, Canada
North Carolina
North Dakota
Nebraska
New Hampshire
New Jersey
New Mexico
Nevada
New York
Newfoundland, Canada
Northwest Territories, Canada
Nova Scotia, Canada
Nunavut, Canada
Ohio
Oklahoma
Ontario, Canada
Oregon
Palau
Pennsylvania
Prince Edward Island, Canada
Puerto Rico
Quebec, Canada
Rhode Island
Saskatchewan, Canada
South Carolina
South Dakota
Tennessee
Texas
Utah
Virgin Islands
Vermont
Virginia
Washington
Wisconsin
West Virginia
Wyoming
Yukon, Canada
Other...
1. Since each country has a different set of states,
this needs to appear/disappear/change depending on user choice of country.
2. Providing both a pull-down and entry for the same data provides an alternative for users.
So JavaScript to make selection in one field result in selection in the other field
provides confirmation of the user's choice.
But this may confuse some people who think they have to do both.
3. TODO: Here is a good place to pre-populate
the state based on known geolocations of the user's IP address,
which is not always reliable, but reliable enough at the state level.
4. The state can be pre-selected based on the zip code or
5. TODO: Here is a good place to use an autocomplete control
rather than a pull down to select from a named list. But avoid a round-trip to the server by providing it in the
JavaScript pre-loaded.
6. The text input field and "Other..." at the end of the drop-down for future flexibility.
Included in the list are Canadian Provinces, US Military, and
US Insula Areas (such as American Samoa, Guam, Puerto Rico, and Virgin Islands) are included.
Mexico Provinces:
Mexico:
AG = Aguascalientes Aguascalientes
BC = Baja California Norte Mexicali
BS = Baja California Sur La Paz
CH = Chihuahua Chihuahua
CL = Colima Colima
CM = Campeche Campeche
CO = Coahuila Saltillo
CS = Chiapas Tuxtla Gutiérrez
DF = Distrito Federal
DG = Durango Durango
GR = Guerrero Chilpancingo de los Bravo
GT = Guanajuato Guanajuato
HG = Hidalgo Pachuca de Soto
JA = Jalisco Guadalajara
MI = Michoacan Morelia
MO = Morelos Cuernavaca
NA = Nayarit Tepic
NL = Nuevo Leon Monterrey
OA = Oaxaca Oaxaca de Juárez
PU = Puebla Puebla de Zaragoza
QR = Quintana Roo Chetumal
QT = Queretaro Santiago de Querétaro
SI = Sinaloa Culiacán
SL = San Luis Potosi San Luis Potosi
SO = Sonora Hermosillo
TB = Tabasco Villahermosa
TL = Tlaxcala Tlaxcala de Xicoténcatl
TM = Tamaulipas Ciudad Victoria
VE = Veracruz Xalapa
YU = Yucatan Mérida
ZA = Zacatecas Zacatecas
a. It's unfortunate that only three abbreviations of states in Mexico (MI, MO, BC)
overlap state codes for the US and Canada.
b. HTML for this list need to be stored in UTF-8 format.