SQL to add drop down options for US States

RJ Daniel

New Member
Simply change "17" to your form id #:

INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('1', '17', 'Alabama', 'AL', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('2', '17', 'Alaska', 'AK', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('3', '17', 'Arizona', 'AZ', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('4', '17', 'Arkansas', 'AR', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('5', '17', 'California', 'CA', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('6', '17', 'Colorado', 'CO', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('7', '17', 'Connecticut', 'CT', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('8', '17', 'Delaware', 'DE', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('9', '17', 'District Of Columbia', 'DC', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('10', '17', 'Florida', 'FL', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('11', '17', 'Georgia', 'GA', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('12', '17', 'Hawaii', 'HI', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('13', '17', 'Idaho', 'ID', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('14', '17', 'Illinois', 'IL', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('15', '17', 'Iowa', 'IA', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('16', '17', 'Kansas', 'KS', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('17', '17', 'Kentucky', 'KY', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('18', '17', 'Louisiana', 'LA', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('19', '17', 'Maine', 'ME', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('20', '17', 'Maryland', 'MD', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('21', '17', 'Massachusetts', 'MA', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('22', '17', 'Michigan', 'MI', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('23', '17', 'Minnesota', 'MN', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('24', '17', 'Mississippi', 'MS', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('25', '17', 'Missouri', 'MO', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('26', '17', 'Montana', 'MT', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('27', '17', 'Nebraska', 'NE', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('28', '17', 'Nevada', 'NV', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('29', '17', 'New Hampshire', 'NH', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('30', '17', 'New Jersey', 'NJ', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('31', '17', 'New Mexico', 'NM', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('32', '17', 'New York', 'NY', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('33', '17', 'North Carolina', 'NC', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('34', '17', 'North Dakota', 'ND', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('35', '17', 'Ohio', 'OH', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('36', '17', 'Oaklahoma', 'OK', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('37', '17', 'Oregon', 'OR', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('38', '17', 'Pennsylvania', 'PA', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('39', '17', 'Rhode Island', 'RI', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('40', '17', 'South Carolina', 'SC', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('41', '17', 'South Dakota', 'SD', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('42', '17', 'Tennessee', 'TN', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('43', '17', 'Texas', 'TX', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('44', '17', 'Utah', 'UT', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('45', '17', 'Vermont', 'VT', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('46', '17', 'Virginia', 'VA', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('47', '17', 'Washington', 'WA', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('48', '17', 'West Virginia', 'WV', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('49', '17', 'Wisconsin', 'WI', 'no', '', '');
INSERT INTO `mw_list_field_option` (`option_id`, `field_id`, `name`, `value`, `is_default`, `date_added`, `last_updated`) VALUES ('50', '17', 'Wyoming', 'WY', 'no', '', '');
 
Guys, for what matters, mailwizz >= 1.3.7.8 added special custom fields for country and state which can also be dependant, which means if you have a country and a state field and you select united states as the country, the states field will autoload all the US states, etc ;)
 
Back
Top