Compare commits

...

4 Commits

Author SHA1 Message Date
Will Bradley
c3d6546414 Adding input value as default value
It's extra work to set the data-default-value to the "selected value" during form validation errors, so I changed to default to the item's value if specified.
2015-02-24 14:46:45 -07:00
Ben Keen
b95192c49a 0.1.3 - Ukraine regions updated 2015-02-10 17:37:04 -08:00
Benjamin Keen
f934cf74dc npm version update 2014-11-01 09:32:55 -07:00
Benjamin Keen
52cb471050 0.1.2 2014-11-01 09:26:22 -07:00
7 changed files with 25 additions and 19 deletions

View File

@ -1,4 +1,4 @@
## Country-Region-Selector (CRS) ## Country-Region-Selector
A common form feature is dynamic, connected country and region dropdowns, where the region field is updated to contain 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 whatever regions (provinces / states / territories / counties etc.) are appropriate for the selected country. It's super
@ -93,8 +93,10 @@ That will then re-generate the minified files in your ./source folder.
### Changelog ### Changelog
- `0.1.1` - April 24, updated country list for ISO 3166 countries and short codes - `0.1.3` - Feb 10, 2015. Updated Ukraine regions.
- `0.1.0` - March 27, initial version - `0.1.2` - Nov 1, 2014. Fix for typo in UK counties list.
- `0.1.1` - April 24, 2014. Updated country list for ISO 3166 countries and short codes
- `0.1.0` - March 27, 2014. Initial version
### License ### License

View File

@ -1,6 +1,6 @@
{ {
"name": "country-region-selector", "name": "country-region-selector",
"version": "0.1.1", "version": "0.1.3",
"main": "source/crs.min.js", "main": "source/crs.min.js",
"license": "MIT", "license": "MIT",
"ignore": [ "ignore": [

View File

@ -1,6 +1,6 @@
{ {
"name": "country-region-dropdowns", "name": "country-region-dropdowns",
"version": "0.1.1", "version": "0.1.3",
"description": "A simple, configurable JS script that lets you add a country dropdown that automatically updates a corresponding region dropdown in your forms.", "description": "A simple, configurable JS script that lets you add a country dropdown that automatically updates a corresponding region dropdown in your forms.",
"main": "example.html", "main": "example.html",
"scripts": { "scripts": {

View File

@ -1,7 +1,7 @@
/** /**
* country-region-dropdowns * country-region-dropdowns
* ------------------------ * ------------------------
* v0.1.1 * v0.1.3
* @author Ben Keen * @author Ben Keen
* @url https://github.com/benkeen/country-region-dropdowns * @url https://github.com/benkeen/country-region-dropdowns
* @licence MIT * @licence MIT
@ -247,9 +247,9 @@
["Turks and Caicos Islands","TC","Turks and Caicos Islands"], ["Turks and Caicos Islands","TC","Turks and Caicos Islands"],
["Tuvalu","TV","Tuvalu"], ["Tuvalu","TV","Tuvalu"],
["Uganda","UG","Adjumani|Apac|Arua|Bugiri|Bundibugyo|Bushenyi|Busia|Gulu|Hoima|Iganga|Jinja|Kabale|Kabarole|Kalangala|Kampala|Kamuli|Kapchorwa|Kasese|Katakwi|Kibaleisoro|Kitgum|Kotido|Kumi|Lira|Luwero|Masaka|Masindi|Mbale|Mbarara|Moroto|Moyo|Mpigi|Mubende|Mukono|Nakasongola|Nebbi|Ntungamo|Pallisa|Rakai|Rukungirie|Soroti|Tororo"], ["Uganda","UG","Adjumani|Apac|Arua|Bugiri|Bundibugyo|Bushenyi|Busia|Gulu|Hoima|Iganga|Jinja|Kabale|Kabarole|Kalangala|Kampala|Kamuli|Kapchorwa|Kasese|Katakwi|Kibaleisoro|Kitgum|Kotido|Kumi|Lira|Luwero|Masaka|Masindi|Mbale|Mbarara|Moroto|Moyo|Mpigi|Mubende|Mukono|Nakasongola|Nebbi|Ntungamo|Pallisa|Rakai|Rukungirie|Soroti|Tororo"],
["Ukraine","UA","Avtonomna Respublika Krym (Simferopol')|Cherkas'ka (Cherkasy)|Chernihivs'ka (Chernihiv)|Chernivets'ka (Chernivtsi)|Dnipropetrovs'ka (Dnipropetrovs'kka (Donets'k)|Ivano-Frankivs'ka (Ivano-Frankivs'k)|Kharkivs'ka (Kharkiv)|Khersons'ka (Kherson)|Khmel'nyts'ka (Khmel'nyts'kyy)|Kirovohrads'ka (d)|Kyyiv|Kyyivs'ka (Kiev)|L'vivs'ka (L'viv)|Luhans'ka (Luhans'k)|Mykolayivs'ka (Mykolayiv)|Odes'ka (Odesa)|Poltavs'ka (Poltava)|Rivnens'ka (Rivne)ol'|Sums'ka (Sumy)|Ternopil's'ka (Ternopil')|Vinnyts'ka (Vinnytsya)|Volyns'ka (Luts'k)|Zakarpats'ka (Uzhhorod)|Zaporiz'ka (Zaporizhzhya)s'ka (Zhytomyr)"], ["Ukraine","UA","Cherkasy|Chernihiv|Chernivtsi|Dnipropetrovsk|Donetsk|Ivano-Frankivsk|Kharkiv|Kherson|Khmelnytskyi|Kiev|Kirovohrad|Luhansk|Lviv|Mykolaiv|Odessa|Poltava|Rivne|Sumy|Ternopil|Vinnytsia|Volyn|Zakarpattia|Zaporizhia|Zhytomyr"],
["United Arab Emirates","AE","'Ajman|Abu Zaby (Abu Dhabi)|Al Fujayrah|Ash Shariqah (Sharjah)|Dubayy (Dubai)|Ra's al Khaymah|Umm al Qaywayn"], ["United Arab Emirates","AE","'Ajman|Abu Zaby (Abu Dhabi)|Al Fujayrah|Ash Shariqah (Sharjah)|Dubayy (Dubai)|Ra's al Khaymah|Umm al Qaywayn"],
["United Kingdom","GB","Barking and Dagenham|Barnet|Barnsley|Bath and North East Somerset|Bedfordshire|Bexley|Birmingham|Blackburn with ackpool|Bolton|Bournemouth|Bracknell Forest|Bradford|Brent|Brighton and ley|Buckinghamshire|Bury|Calderdale|Cambridgeshire|Camden|Cheshire|City of Bristol|City of Kingston upon Hull|City of rnwall|Coventry|Croydon|Cumbria|Darlington|Derby|Derbyshire|Devon|Doncaster|Dorset|Dudley|Durham|Ealing|East Riding of Yorkshire|East field|Essex|Gateshead|Gloucestershire|Greenwich|Hackney|Halton|Hammersmith and mpshire|Haringey|Harrow|Hartlepool|Havering|Herefordshire|Hertfordshire|Hillingdon|Hounslow|Isle of Wight|Islington|Kensington and ent|Kingston upon Thames|Kirklees|Knowsley|Lambeth|Lancashire|Leeds|Leicester|Leicestershire|Lewisham|Lincolnshire|Liverpool|Luton|Manchester|Medway|ddlesbrough|Milton Keynes|Newcastle upon Tyne|Newham|Norfolk|North East Lincolnshire|North Lincolnshire|North Somerset|North Tyneside|North |Northamptonshire|Northumberland|Nottingham|Nottinghamshire|Oldham|Oxfordshire|Peterborough|Plymouth|Poole|Portsmouth|Reading|Redbridge|Redcar and |Richmond upon Thames|Rochdale|Rotherham|Rutland|Salford|Sandwell|Sefton|Sheffield|Shropshire|Slough|Solihull|Somerset|South Gloucestershire|South Southampton|Southend-on-Sea|Southwark|St. Helens|Staffordshire|Stockport|Stockton-on-Tees|Stoke-on-folk|Sunderland|Surrey|Sutton|Swindon|Tameside|Telford and Wrekin|Thurrock|Torbay|Tower Hamlets|Trafford|Wakefield|Walsall|Waltham ndsworth|Warrington|Warwickshire|West Berkshire|West Sussex|Westminster|Wigan|Wiltshire|Windsor and d|Wirral|Wokingham|Wolverhampton|Worcestershire|York,Aberdeen City|Aberdeenshire|Angus|Argyll and Bute|City of Edinburgh|Clackmannanshire|Dumfries and Galloway|Dundee City|East Ayrshire|East shire|East Lothian|East Renfrewshire|Eilean Siar (Western Isles)|Falkirk|Fife|Glasgow City|Highland|Inverclyde|Midlothian|Moray|North Ayrshire|North re|Orkney Islands|Perth and Kinross|Renfrewshire|Shetland Islands|South Ayrshire|South Lanarkshire|Stirling|The Scottish Borders|West shire|West Lothian"], ["United Kingdom","GB","Barking and Dagenham|Barnet|Barnsley|Bath and North East Somerset|Bedfordshire|Bexley|Birmingham|Blackburn with ackpool|Bolton|Bournemouth|Bracknell Forest|Bradford|Brent|Brighton and ley|Buckinghamshire|Bury|Calderdale|Cambridgeshire|Camden|Cheshire|City of Bristol|City of Kingston upon Hull|City of rnwall|Coventry|Croydon|Cumbria|Darlington|Derby|Derbyshire|Devon|Doncaster|Dorset|Dudley|Durham|Ealing|East Riding of Yorkshire|East field|Essex|Gateshead|Gloucestershire|Greenwich|Hackney|Halton|Hammersmith and mpshire|Haringey|Harrow|Hartlepool|Havering|Herefordshire|Hertfordshire|Hillingdon|Hounslow|Isle of Wight|Islington|Kensington and ent|Kingston upon Thames|Kirklees|Knowsley|Lambeth|Lancashire|Leeds|Leicester|Leicestershire|Lewisham|Lincolnshire|Liverpool|Luton|Manchester|Medway|Middlesbrough|Milton Keynes|Newcastle upon Tyne|Newham|Norfolk|North East Lincolnshire|North Lincolnshire|North Somerset|North Tyneside|North |Northamptonshire|Northumberland|Nottingham|Nottinghamshire|Oldham|Oxfordshire|Peterborough|Plymouth|Poole|Portsmouth|Reading|Redbridge|Redcar and |Richmond upon Thames|Rochdale|Rotherham|Rutland|Salford|Sandwell|Sefton|Sheffield|Shropshire|Slough|Solihull|Somerset|South Gloucestershire|South Southampton|Southend-on-Sea|Southwark|St. Helens|Staffordshire|Stockport|Stockton-on-Tees|Stoke-on-folk|Sunderland|Surrey|Sutton|Swindon|Tameside|Telford and Wrekin|Thurrock|Torbay|Tower Hamlets|Trafford|Wakefield|Walsall|Waltham ndsworth|Warrington|Warwickshire|West Berkshire|West Sussex|Westminster|Wigan|Wiltshire|Windsor and d|Wirral|Wokingham|Wolverhampton|Worcestershire|York,Aberdeen City|Aberdeenshire|Angus|Argyll and Bute|City of Edinburgh|Clackmannanshire|Dumfries and Galloway|Dundee City|East Ayrshire|East shire|East Lothian|East Renfrewshire|Eilean Siar (Western Isles)|Falkirk|Fife|Glasgow City|Highland|Inverclyde|Midlothian|Moray|North Ayrshire|North re|Orkney Islands|Perth and Kinross|Renfrewshire|Shetland Islands|South Ayrshire|South Lanarkshire|Stirling|The Scottish Borders|West shire|West Lothian"],
["United States","US","Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|District of Columbia|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming"], ["United States","US","Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|District of Columbia|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming"],
["United States Minor Outlying Islands","UM","Wake Island|Johnston Atoll|Midway Atoll|Kingman Reef|Palmyra Atoll|Jarvis Island|Baker Island|Howland Island|Navassa Island|Bajo Nuevo Bank|Serranilla Bank"], ["United States Minor Outlying Islands","UM","Wake Island|Johnston Atoll|Midway Atoll|Kingman Reef|Palmyra Atoll|Jarvis Island|Baker Island|Howland Island|Navassa Island|Bajo Nuevo Bank|Serranilla Bank"],
["Uruguay","UY","Artigas|Canelones|Cerro Largo|Colonia|Durazno|Flores|Florida|Lavalleja|Maldonado|Montevideo|Paysandú|Río Negro|Rivera|Rocha|Salto|San José|Soriano|Tacuaremb|Treinta"], ["Uruguay","UY","Artigas|Canelones|Cerro Largo|Colonia|Durazno|Flores|Florida|Lavalleja|Maldonado|Montevideo|Paysandú|Río Negro|Rivera|Rocha|Salto|San José|Soriano|Tacuaremb|Treinta"],

2
source/crs.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
/** /**
* country-region-dropdowns * country-region-dropdowns
* ------------------------ * ------------------------
* v0.1.1 * v0.1.2
* @author Ben Keen * @author Ben Keen
* @url https://github.com/benkeen/country-region-dropdowns * @url https://github.com/benkeen/country-region-dropdowns
* @licence MIT * @licence MIT
@ -12,6 +12,8 @@
var _countryClass = "crs-country"; var _countryClass = "crs-country";
var _defaultCountryStr = "Select country"; var _defaultCountryStr = "Select country";
var _defaultRegionStr = "Select region"; var _defaultRegionStr = "Select region";
var _defaultCountryValue = null;
var _defaultRegionValue = null;
// originally an object, but converted to an array to reduce size // originally an object, but converted to an array to reduce size
var _data = [ var _data = [
@ -247,9 +249,9 @@
["Turks and Caicos Islands","TC","Turks and Caicos Islands"], ["Turks and Caicos Islands","TC","Turks and Caicos Islands"],
["Tuvalu","TV","Tuvalu"], ["Tuvalu","TV","Tuvalu"],
["Uganda","UG","Adjumani|Apac|Arua|Bugiri|Bundibugyo|Bushenyi|Busia|Gulu|Hoima|Iganga|Jinja|Kabale|Kabarole|Kalangala|Kampala|Kamuli|Kapchorwa|Kasese|Katakwi|Kibaleisoro|Kitgum|Kotido|Kumi|Lira|Luwero|Masaka|Masindi|Mbale|Mbarara|Moroto|Moyo|Mpigi|Mubende|Mukono|Nakasongola|Nebbi|Ntungamo|Pallisa|Rakai|Rukungirie|Soroti|Tororo"], ["Uganda","UG","Adjumani|Apac|Arua|Bugiri|Bundibugyo|Bushenyi|Busia|Gulu|Hoima|Iganga|Jinja|Kabale|Kabarole|Kalangala|Kampala|Kamuli|Kapchorwa|Kasese|Katakwi|Kibaleisoro|Kitgum|Kotido|Kumi|Lira|Luwero|Masaka|Masindi|Mbale|Mbarara|Moroto|Moyo|Mpigi|Mubende|Mukono|Nakasongola|Nebbi|Ntungamo|Pallisa|Rakai|Rukungirie|Soroti|Tororo"],
["Ukraine","UA","Avtonomna Respublika Krym (Simferopol')|Cherkas'ka (Cherkasy)|Chernihivs'ka (Chernihiv)|Chernivets'ka (Chernivtsi)|Dnipropetrovs'ka (Dnipropetrovs'kka (Donets'k)|Ivano-Frankivs'ka (Ivano-Frankivs'k)|Kharkivs'ka (Kharkiv)|Khersons'ka (Kherson)|Khmel'nyts'ka (Khmel'nyts'kyy)|Kirovohrads'ka (d)|Kyyiv|Kyyivs'ka (Kiev)|L'vivs'ka (L'viv)|Luhans'ka (Luhans'k)|Mykolayivs'ka (Mykolayiv)|Odes'ka (Odesa)|Poltavs'ka (Poltava)|Rivnens'ka (Rivne)ol'|Sums'ka (Sumy)|Ternopil's'ka (Ternopil')|Vinnyts'ka (Vinnytsya)|Volyns'ka (Luts'k)|Zakarpats'ka (Uzhhorod)|Zaporiz'ka (Zaporizhzhya)s'ka (Zhytomyr)"], ["Ukraine","UA","Cherkasy|Chernihiv|Chernivtsi|Dnipropetrovsk|Donetsk|Ivano-Frankivsk|Kharkiv|Kherson|Khmelnytskyi|Kiev|Kirovohrad|Luhansk|Lviv|Mykolaiv|Odessa|Poltava|Rivne|Sumy|Ternopil|Vinnytsia|Volyn|Zakarpattia|Zaporizhia|Zhytomyr"],
["United Arab Emirates","AE","'Ajman|Abu Zaby (Abu Dhabi)|Al Fujayrah|Ash Shariqah (Sharjah)|Dubayy (Dubai)|Ra's al Khaymah|Umm al Qaywayn"], ["United Arab Emirates","AE","'Ajman|Abu Zaby (Abu Dhabi)|Al Fujayrah|Ash Shariqah (Sharjah)|Dubayy (Dubai)|Ra's al Khaymah|Umm al Qaywayn"],
["United Kingdom","GB","Barking and Dagenham|Barnet|Barnsley|Bath and North East Somerset|Bedfordshire|Bexley|Birmingham|Blackburn with ackpool|Bolton|Bournemouth|Bracknell Forest|Bradford|Brent|Brighton and ley|Buckinghamshire|Bury|Calderdale|Cambridgeshire|Camden|Cheshire|City of Bristol|City of Kingston upon Hull|City of rnwall|Coventry|Croydon|Cumbria|Darlington|Derby|Derbyshire|Devon|Doncaster|Dorset|Dudley|Durham|Ealing|East Riding of Yorkshire|East field|Essex|Gateshead|Gloucestershire|Greenwich|Hackney|Halton|Hammersmith and mpshire|Haringey|Harrow|Hartlepool|Havering|Herefordshire|Hertfordshire|Hillingdon|Hounslow|Isle of Wight|Islington|Kensington and ent|Kingston upon Thames|Kirklees|Knowsley|Lambeth|Lancashire|Leeds|Leicester|Leicestershire|Lewisham|Lincolnshire|Liverpool|Luton|Manchester|Medway|ddlesbrough|Milton Keynes|Newcastle upon Tyne|Newham|Norfolk|North East Lincolnshire|North Lincolnshire|North Somerset|North Tyneside|North |Northamptonshire|Northumberland|Nottingham|Nottinghamshire|Oldham|Oxfordshire|Peterborough|Plymouth|Poole|Portsmouth|Reading|Redbridge|Redcar and |Richmond upon Thames|Rochdale|Rotherham|Rutland|Salford|Sandwell|Sefton|Sheffield|Shropshire|Slough|Solihull|Somerset|South Gloucestershire|South Southampton|Southend-on-Sea|Southwark|St. Helens|Staffordshire|Stockport|Stockton-on-Tees|Stoke-on-folk|Sunderland|Surrey|Sutton|Swindon|Tameside|Telford and Wrekin|Thurrock|Torbay|Tower Hamlets|Trafford|Wakefield|Walsall|Waltham ndsworth|Warrington|Warwickshire|West Berkshire|West Sussex|Westminster|Wigan|Wiltshire|Windsor and d|Wirral|Wokingham|Wolverhampton|Worcestershire|York,Aberdeen City|Aberdeenshire|Angus|Argyll and Bute|City of Edinburgh|Clackmannanshire|Dumfries and Galloway|Dundee City|East Ayrshire|East shire|East Lothian|East Renfrewshire|Eilean Siar (Western Isles)|Falkirk|Fife|Glasgow City|Highland|Inverclyde|Midlothian|Moray|North Ayrshire|North re|Orkney Islands|Perth and Kinross|Renfrewshire|Shetland Islands|South Ayrshire|South Lanarkshire|Stirling|The Scottish Borders|West shire|West Lothian"], ["United Kingdom","GB","Barking and Dagenham|Barnet|Barnsley|Bath and North East Somerset|Bedfordshire|Bexley|Birmingham|Blackburn with ackpool|Bolton|Bournemouth|Bracknell Forest|Bradford|Brent|Brighton and ley|Buckinghamshire|Bury|Calderdale|Cambridgeshire|Camden|Cheshire|City of Bristol|City of Kingston upon Hull|City of rnwall|Coventry|Croydon|Cumbria|Darlington|Derby|Derbyshire|Devon|Doncaster|Dorset|Dudley|Durham|Ealing|East Riding of Yorkshire|East field|Essex|Gateshead|Gloucestershire|Greenwich|Hackney|Halton|Hammersmith and mpshire|Haringey|Harrow|Hartlepool|Havering|Herefordshire|Hertfordshire|Hillingdon|Hounslow|Isle of Wight|Islington|Kensington and ent|Kingston upon Thames|Kirklees|Knowsley|Lambeth|Lancashire|Leeds|Leicester|Leicestershire|Lewisham|Lincolnshire|Liverpool|Luton|Manchester|Medway|Middlesbrough|Milton Keynes|Newcastle upon Tyne|Newham|Norfolk|North East Lincolnshire|North Lincolnshire|North Somerset|North Tyneside|North |Northamptonshire|Northumberland|Nottingham|Nottinghamshire|Oldham|Oxfordshire|Peterborough|Plymouth|Poole|Portsmouth|Reading|Redbridge|Redcar and |Richmond upon Thames|Rochdale|Rotherham|Rutland|Salford|Sandwell|Sefton|Sheffield|Shropshire|Slough|Solihull|Somerset|South Gloucestershire|South Southampton|Southend-on-Sea|Southwark|St. Helens|Staffordshire|Stockport|Stockton-on-Tees|Stoke-on-folk|Sunderland|Surrey|Sutton|Swindon|Tameside|Telford and Wrekin|Thurrock|Torbay|Tower Hamlets|Trafford|Wakefield|Walsall|Waltham ndsworth|Warrington|Warwickshire|West Berkshire|West Sussex|Westminster|Wigan|Wiltshire|Windsor and d|Wirral|Wokingham|Wolverhampton|Worcestershire|York,Aberdeen City|Aberdeenshire|Angus|Argyll and Bute|City of Edinburgh|Clackmannanshire|Dumfries and Galloway|Dundee City|East Ayrshire|East shire|East Lothian|East Renfrewshire|Eilean Siar (Western Isles)|Falkirk|Fife|Glasgow City|Highland|Inverclyde|Midlothian|Moray|North Ayrshire|North re|Orkney Islands|Perth and Kinross|Renfrewshire|Shetland Islands|South Ayrshire|South Lanarkshire|Stirling|The Scottish Borders|West shire|West Lothian"],
["United States","US","Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|District of Columbia|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming"], ["United States","US","Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|District of Columbia|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming"],
["United States Minor Outlying Islands","UM","Wake Island|Johnston Atoll|Midway Atoll|Kingman Reef|Palmyra Atoll|Jarvis Island|Baker Island|Howland Island|Navassa Island|Bajo Nuevo Bank|Serranilla Bank"], ["United States Minor Outlying Islands","UM","Wake Island|Johnston Atoll|Midway Atoll|Kingman Reef|Palmyra Atoll|Jarvis Island|Baker Island|Howland Island|Navassa Island|Bajo Nuevo Bank|Serranilla Bank"],
["Uruguay","UY","Artigas|Canelones|Cerro Largo|Colonia|Durazno|Flores|Florida|Lavalleja|Maldonado|Montevideo|Paysandú|Río Negro|Rivera|Rocha|Salto|San José|Soriano|Tacuaremb|Treinta"], ["Uruguay","UY","Artigas|Canelones|Cerro Largo|Colonia|Durazno|Flores|Florida|Lavalleja|Maldonado|Montevideo|Paysandú|Río Negro|Rivera|Rocha|Salto|San José|Soriano|Tacuaremb|Treinta"],
@ -274,11 +276,12 @@
var _populateCountryFields = function() { var _populateCountryFields = function() {
var countryElement = this; var countryElement = this;
_defaultCountryValue = $(countryElement).val();
countryElement.length = 0; countryElement.length = 0;
var customOptionStr = $(countryElement).attr("data-default-option"); var customOptionStr = $(countryElement).attr("data-default-option");
var defaultOptionStr = customOptionStr ? customOptionStr : _defaultCountryStr; var defaultOptionStr = customOptionStr ? customOptionStr : _defaultCountryStr;
var defaultSelectedValue = $(countryElement).attr("data-default-value"); var defaultSelectedValue = _defaultCountryValue ? _defaultCountryValue : $(countryElement).attr("data-default-value");
var customValue = $(countryElement).attr("data-value"); var customValue = $(countryElement).attr("data-value");
var foundIndex = 0; var foundIndex = 0;
@ -307,7 +310,7 @@
if (defaultSelectedValue) { if (defaultSelectedValue) {
_populateRegionFields(countryElement, regionElement); _populateRegionFields(countryElement, regionElement);
var defaultRegionSelectedValue = $(regionElement).attr("data-default-value"); var defaultRegionSelectedValue = _defaultRegionValue ? _defaultRegionValue : $(regionElement).attr("data-default-value");
if (defaultRegionSelectedValue !== null) { if (defaultRegionSelectedValue !== null) {
var data = _data[countryElement.selectedIndex-1][2].split("|"); var data = _data[countryElement.selectedIndex-1][2].split("|");
_setDefaultRegionValue(regionElement, data, defaultRegionSelectedValue); _setDefaultRegionValue(regionElement, data, defaultRegionSelectedValue);
@ -320,6 +323,7 @@
}; };
var _initRegionField = function(el) { var _initRegionField = function(el) {
_defaultRegionValue = $(el).val();
var customOptionStr = $(el).attr("data-blank-option"); var customOptionStr = $(el).attr("data-blank-option");
var defaultOptionStr = customOptionStr ? customOptionStr : "-"; var defaultOptionStr = customOptionStr ? customOptionStr : "-";
el.length = 0; el.length = 0;

File diff suppressed because one or more lines are too long