From c2e29c98bab114905b5fe76f257b7d7ce47ebfde Mon Sep 17 00:00:00 2001 From: Ben Keen Date: Mon, 24 Mar 2014 20:08:39 -0700 Subject: [PATCH] Finished up script + doc --- README.md | 16 +++++++++ example.html | 31 +++++++++++----- gruntfile.js | 12 ++++++- source/country-region-selector.js | 59 ++++++++++++++++++------------- 4 files changed, 85 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index c670591..5fe2a8c 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,22 @@ If your form is used for people returning to it (e.g. "Edit Contact Info" or wha region fields to be prefilled with the appropriate value on page load. To do that, just add a `data-default=""` attribute to each element containing the country / region value last saved. +### List of data-* attributes + +This lists all the available data-* attributes that you can add to the country/region fields to customize the appearance +and behaviour. + +##### country fields + +- `data-region-id` - required. This should contain the ID of the region field that it's being mapped to. +- `data-default-option` - optional. Default: "Select country". This determines the default, blank option display value. + +##### region fields +- `data-blank-option` - before the user selects a country, there's a single