This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

Different top country names in the country section of the address field


  1. Fa
    Member

    Hi,
    I wanted a different list of top names in the country list field, so instead of playing with indexes and offseting them, i modified the function mf_get_country_list like below.
    (Yuniar: Maybe something of that kind could be included in a next release, thanks.)

    function mf_get_country_list()
    {
    $arr = array(
    array("United States","United States"),
    array("United Kingdom","United Kingdom"),
    array("Canada","Canada"),
    array("Australia","Australia"),
    array("Netherlands","Netherlands"),
    array("France","France"),
    array("Germany","Germany"),
    array("-------",""),
    array("Afghanistan","Afghanistan"),
    array("Albania","Albania"),
    array("Algeria","Algeria"),
    array("Andorra","Andorra"),
    array("Antigua and Barbuda","Antigua and Barbuda"),
    array("Argentina","Argentina"),
    array("Armenia","Armenia"),
    array("Austria","Austria"),
    array("Azerbaijan","Azerbaijan"),
    array("Bahamas","Bahamas"),
    array("Bahrain","Bahrain"),
    array("Bangladesh","Bangladesh"),
    array("Barbados","Barbados"),
    array("Belarus","Belarus"),
    array("Belgium","Belgium"),
    array("Belize","Belize"),
    array("Benin","Benin"),
    array("Bhutan","Bhutan"),
    array("Bolivia","Bolivia"),
    array("Bosnia and Herzegovina","Bosnia and Herzegovina"),
    array("Botswana","Botswana"),
    array("Brazil","Brazil"),
    array("Brunei","Brunei"),
    array("Bulgaria","Bulgaria"),
    array("Burkina Faso","Burkina Faso"),
    array("Burundi","Burundi"),
    array("Cambodia","Cambodia"),
    array("Cameroon","Cameroon"),
    array("Cape Verde","Cape Verde"),
    array("Central African Republic","Central African Republic"),
    array("Chad","Chad"),
    array("Chile","Chile"),
    array("China","China"),
    array("Colombia","Colombia"),
    array("Comoros","Comoros"),
    array("Congo","Congo"),
    array("Costa Rica","Costa Rica"),
    array("Côte d'Ivoire","Côte d'Ivoire"),
    array("Croatia","Croatia"),
    array("Cuba","Cuba"),
    array("Cyprus","Cyprus"),
    array("Czech Republic","Czech Republic"),
    array("Denmark","Denmark"),
    array("Djibouti","Djibouti"),
    array("Dominica","Dominica"),
    array("Dominican Republic","Dominican Republic"),
    array("East Timor","East Timor"),
    array("Ecuador","Ecuador"),
    array("Egypt","Egypt"),
    array("El Salvador","El Salvador"),
    array("Equatorial Guinea","Equatorial Guinea"),
    array("Eritrea","Eritrea"),
    array("Estonia","Estonia"),
    array("Ethiopia","Ethiopia"),
    array("Fiji","Fiji"),
    array("Finland","Finland"),
    array("Gabon","Gabon"),
    array("Gambia","Gambia"),
    array("Georgia","Georgia"),
    array("Ghana","Ghana"),
    array("Greece","Greece"),
    array("Grenada","Grenada"),
    array("Guatemala","Guatemala"),
    array("Guernsey","Guernsey"),
    array("Guinea","Guinea"),
    array("Guinea-Bissau","Guinea-Bissau"),
    array("Guyana","Guyana"),
    array("Haiti","Haiti"),
    array("Honduras","Honduras"),
    array("Hong Kong","Hong Kong"),
    array("Hungary","Hungary"),
    array("Iceland","Iceland"),
    array("India","India"),
    array("Indonesia","Indonesia"),
    array("Iran","Iran"),
    array("Iraq","Iraq"),
    array("Ireland","Ireland"),
    array("Israel","Israel"),
    array("Italy","Italy"),
    array("Jamaica","Jamaica"),
    array("Japan","Japan"),
    array("Jordan","Jordan"),
    array("Kazakhstan","Kazakhstan"),
    array("Kenya","Kenya"),
    array("Kiribati","Kiribati"),
    array("North Korea","North Korea"),
    array("South Korea","South Korea"),
    array("Kuwait","Kuwait"),
    array("Kyrgyzstan","Kyrgyzstan"),
    array("Laos","Laos"),
    array("Latvia","Latvia"),
    array("Lebanon","Lebanon"),
    array("Lesotho","Lesotho"),
    array("Liberia","Liberia"),
    array("Libya","Libya"),
    array("Liechtenstein","Liechtenstein"),
    array("Lithuania","Lithuania"),
    array("Luxembourg","Luxembourg"),
    array("Macedonia","Macedonia"),
    array("Madagascar","Madagascar"),
    array("Malawi","Malawi"),
    array("Malaysia","Malaysia"),
    array("Maldives","Maldives"),
    array("Mali","Mali"),
    array("Malta","Malta"),
    array("Marshall Islands","Marshall Islands"),
    array("Mauritania","Mauritania"),
    array("Mauritius","Mauritius"),
    array("Mexico","Mexico"),
    array("Micronesia","Micronesia"),
    array("Moldova","Moldova"),
    array("Monaco","Monaco"),
    array("Mongolia","Mongolia"),
    array("Montenegro","Montenegro"),
    array("Morocco","Morocco"),
    array("Mozambique","Mozambique"),
    array("Myanmar","Myanmar"),
    array("Namibia","Namibia"),
    array("Nauru","Nauru"),
    array("Nepal","Nepal"),
    array("New Zealand","New Zealand"),
    array("Nicaragua","Nicaragua"),
    array("Niger","Niger"),
    array("Nigeria","Nigeria"),
    array("Norway","Norway"),
    array("Oman","Oman"),
    array("Pakistan","Pakistan"),
    array("Palau","Palau"),
    array("Panama","Panama"),
    array("Papua New Guinea","Papua New Guinea"),
    array("Paraguay","Paraguay"),
    array("Peru","Peru"),
    array("Philippines","Philippines"),
    array("Poland","Poland"),
    array("Portugal","Portugal"),
    array("Puerto Rico","Puerto Rico"),
    array("Qatar","Qatar"),
    array("Romania","Romania"),
    array("Russia","Russia"),
    array("Rwanda","Rwanda"),
    array("Saint Kitts and Nevis","Saint Kitts and Nevis"),
    array("Saint Lucia","Saint Lucia"),
    array("Saint Vincent and the Grenadines","Saint Vincent and the Grenadines"),
    array("Samoa","Samoa"),
    array("San Marino","San Marino"),
    array("Sao Tome and Principe","Sao Tome and Principe"),
    array("Saudi Arabia","Saudi Arabia"),
    array("Senegal","Senegal"),
    array("Serbia and Montenegro","Serbia and Montenegro"),
    array("Seychelles","Seychelles"),
    array("Sierra Leone","Sierra Leone"),
    array("Singapore","Singapore"),
    array("Slovakia","Slovakia"),
    array("Slovenia","Slovenia"),
    array("Solomon Islands","Solomon Islands"),
    array("Somalia","Somalia"),
    array("South Africa","South Africa"),
    array("Spain","Spain"),
    array("Sri Lanka","Sri Lanka"),
    array("Sudan","Sudan"),
    array("Suriname","Suriname"),
    array("Swaziland","Swaziland"),
    array("Sweden","Sweden"),
    array("Switzerland","Switzerland"),
    array("Syria","Syria"),
    array("Taiwan","Taiwan"),
    array("Tajikistan","Tajikistan"),
    array("Tanzania","Tanzania"),
    array("Thailand","Thailand"),
    array("Togo","Togo"),
    array("Tonga","Tonga"),
    array("Trinidad and Tobago","Trinidad and Tobago"),
    array("Tunisia","Tunisia"),
    array("Turkey","Turkey"),
    array("Turkmenistan","Turkmenistan"),
    array("Tuvalu","Tuvalu"),
    array("Uganda","Uganda"),
    array("Ukraine","Ukraine"),
    array("United Arab Emirates","United Arab Emirates"),
    array("Uruguay","Uruguay"),
    array("Uzbekistan","Uzbekistan"),
    array("Vanuatu","Vanuatu"),
    array("Vatican City","Vatican City"),
    array("Venezuela","Venezuela"),
    array("Vietnam","Vietnam"),
    array("Yemen","Yemen"),
    array("Zambia","Zambia"),
    array("Zimbabwe","Zimbabwe"),
    );

    $countries = array();
    foreach($arr as $row)
    {
    $countries[]= array("label" => $row[0], "value" => $row[1]);
    }
    return $countries;
    }

    Posted 11 years ago #

RSS feed for this topic

Reply