From 25a8af6be823f75f7ed6014ed6d4da4fc6f04212 Mon Sep 17 00:00:00 2001 From: Ben Keen Date: Tue, 25 Mar 2014 22:40:03 -0700 Subject: [PATCH] doc update --- README.md | 14 ++++++------- example.html | 59 ---------------------------------------------------- 2 files changed, 7 insertions(+), 66 deletions(-) delete mode 100644 example.html diff --git a/README.md b/README.md index c4f9b91..a3009b8 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ ## Country-Region-Selector (CRS) -A common thing you often see in forms is a country dropdown which changes the contents of a second region field -when a country is selected. It's super easy to do this, but requires a lot of leg work tracking down the data and -rigging it all up in your form. This script let's you set that all up automatically without having to run any custom -javascript. +A common form feature is dynamic, connected country and region dropdowns, where the region field is updated to contain +whatever regions (provinces / states / territories / counties etc.) are appropriate for the selected country. It's super +easy to do this, but requires a lot of leg work tracking down the data and hooking it all up. This script lets you easily +add this feature to your form without having to write any code. -The script comes in two flavours: -- standalone script (no dependencies, just plain JS) - **54KB** (minified version) -- a jQuery-dependent version (ever-so slightly smaller) - **53KB** (minified version) +It comes in two flavours: +- [standalone script](./source/crs.min.js) (no dependencies, just plain JS) - **54KB** (minified version) +- a [jQuery-dependent version](./source/crs.min.js) (ever-so slightly smaller) - **53KB** (minified version) The reason the files are so large is that they contain all the country and region strings. diff --git a/example.html b/example.html deleted file mode 100644 index 9c6eb5f..0000000 --- a/example.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - country-region-dropdowns example - - - -

country-region-dropdowns example

- -

Example 1

- -

- This is a simple no-frills example. -

- - - - -
- - -

Example 2

- -

- Custom default option texts for both the country and region dropdowns. -

- - - - -
- - -

Example 3

- -

- The country dropdown values are by default the same as the display values: the full country names. - By adding the data-value="2-char" attribute to the country field, the values will be a 2-char - character code. -

- - - - -
- -

Example 4

- -

- Pre-filling the fields on page load. -

- - - - - - - - \ No newline at end of file