country-region-selector/example.html
2014-03-24 20:53:49 -07:00

59 lines
1.5 KiB
HTML

<!doctype html>
<html>
<head>
<title>country-region-dropdowns example</title>
</head>
<body>
<h1>country-region-dropdowns example</h1>
<h2>Example 1</h2>
<p>
This is a simple no-frills example.
</p>
<select class="crs-country" data-region-id="one"></select>
<select id="one"></select>
<hr size="1" />
<h2>Example 2</h2>
<p>
Custom default option texts for both the country and region dropdowns.
</p>
<select class="crs-country" data-region-id="two" data-default-option="Select a country, man."></select>
<select id="two" data-blank-option="No country selected, mon. (blank value)" data-default-option="Select a region, pal. (default option)"></select>
<hr size="1" />
<h2>Example 3</h2>
<p>
The country dropdown values are by default the same as the display values: the full country names.
By adding the <b>data-value="2-char"</b> attribute to the country field, the values will be a 2-char
character code.
</p>
<select class="crs-country" data-region-id="three" data-value="2-char"></select>
<select id="three"></select>
<hr size="1" />
<h2>Example 4</h2>
<p>
Pre-filling the fields on page load.
</p>
<select class="crs-country" data-region-id="four" data-default-value="Canada"></select>
<select id="four" data-default-value="British Columbia"></select>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="source/jquery.crs.js"></script>
</body>
</html>