• Your shopping cart is empty!

Country-Region Dropdown Menu (Free)

FREE

A dropdown menu created with javascript that allows user to implement country-region dropdown list effortlessly. Country-Region Dropdown Menu is needed mostly in forms where the region field will get updated automatically when there is a change on the country field. It can be applied as easy as by entering the given required attributes into the country and region field respectively. Besides, user may also set the default value for each country and region field.

Attributes

  • Country field must be given a class name as gds-cr .
  • country-data-region-id is required in country field that contains the id of region field.
  • country-data-default-value is optional in country field which use to set the default selected country value, it supports both ISO3166-1 alpha-2 Country Code and country full name.
  • region-data-default-value is optional in region field which use set the default selected region value.

Usage
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Country-Region DropDown Menu</title>

    <script src="geodatasource-cr.min.js"></script>
  </head>
  <body>

    <div>
        Country: <select class="gds-cr" country-data-region-id="gds-cr-one" ></select>

        Region: <select id="gds-cr-one" ></select>
    </div>

    <div>
        Country: <select class="gds-cr" country-data-region-id="gds-cr-two" country-data-default-value="US"></select>

        Region: <select id="gds-cr-two" region-data-default-value="California"></select>
    </div>

  </body>
</html>