USA states - select form item

Public

</> CopyGet raw version
php
  1. $form['state'] = array(
  2. '#type' => 'select',
  3. '#title' => t('State'),
  4. '#options' => array(
  5. 'AL' => 'Alabama',
  6. 'AK' => 'Alaska',
  7. 'AS' => 'American Samoa',
  8. 'AZ' => 'Arizona',
  9. 'AR' => 'Arkansas',
  10. 'CA' => 'California',
  11. 'CO' => 'Colorado',
  12. 'CT' => 'Connecticut',
  13. 'DE' => 'Delaware',
  14. 'DC' => 'District Of Columbia',
  15. 'FM' => 'Federated States Of Micronesia',
  16. 'FL' => 'Florida',
  17. 'GA' => 'Georgia',
  18. 'GU' => 'Guam GU',
  19. 'HI' => 'Hawaii',
  20. 'ID' => 'Idaho',
  21. 'IL' => 'Illinois',
  22. 'IN' => 'Indiana',
  23. 'IA' => 'Iowa',
  24. 'KS' => 'Kansas',
  25. 'KY' => 'Kentucky',
  26. 'LA' => 'Louisiana',
  27. 'ME' => 'Maine',
  28. 'MH' => 'Marshall Islands',
  29. 'MD' => 'Maryland',
  30. 'MA' => 'Massachusetts',
  31. 'MI' => 'Michigan',
  32. 'MN' => 'Minnesota',
  33. 'MS' => 'Mississippi',
  34. 'MO' => 'Missouri',
  35. 'MT' => 'Montana',
  36. 'NE' => 'Nebraska',
  37. 'NV' => 'Nevada',
  38. 'NH' => 'New Hampshire',
  39. 'NJ' => 'New Jersey',
  40. 'NM' => 'New Mexico',
  41. 'NY' => 'New York',
  42. 'NC' => 'North Carolina',
  43. 'ND' => 'North Dakota',
  44. 'MP' => 'Northern Mariana Islands',
  45. 'OH' => 'Ohio',
  46. 'OK' => 'Oklahoma',
  47. 'OR' => 'Oregon',
  48. 'PW' => 'Palau',
  49. 'PA' => 'Pennsylvania',
  50. 'PR' => 'Puerto Rico',
  51. 'RI' => 'Rhode Island',
  52. 'SC' => 'South Carolina',
  53. 'SD' => 'South Dakota',
  54. 'TN' => 'Tennessee',
  55. 'TX' => 'Texas',
  56. 'UT' => 'Utah',
  57. 'VT' => 'Vermont',
  58. 'VI' => 'Virgin Islands',
  59. 'VA' => 'Virginia',
  60. 'WA' => 'Washington',
  61. 'WV' => 'West Virginia',
  62. 'WI' => 'Wisconsin',
  63. 'WY' => 'Wyoming',
  64. ),
  65. '#required' => TRUE,
  66. );