Turns any select tag into an autocomplete field with weighted options, synonyms and loose matching
JavaScript HTML
Pull request Compare This branch is 19 commits ahead, 16 commits behind JamieAppleseed:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
country-list @ abb111a
locales
.gitmodules
README.md
example.html
jquery.select-to-autocomplete.js
jquery.select-to-autocomplete.min.js
nodejs.countryList.js
package.json
test.nodejs.countryList.js

README.md

NPM-selectToAutocomplete

A trivial fork of https://github.com/JamieAppleseed/selectToAutocomplete to make it more accessible in Node apps. The purpose is an HTML country selector that improves UX on standard drop-down country selectors.

On the client side it modifies the default select widget. On the server side it generates HTML for the complete exhaustive country list compatible with the requirements of the client, including specialized attributes.

In addition to this package you'll need jQuery, a jquery autocomplete plugin, and CSS to style the HTML for the country selector. See sample.html to get started. You might also find test.nodejs.countryList.js a helpful example.

To use on the server side do 'npm i country-selector'. Then in your node module:

var lib = require("./nodejs.countryList.js");
var defaultCountry = 'Vanuatu';
var cl = lib.countryList(defaultCountry);
// insert the HTML you have generated into your template
res.render('template.html', { placeholderInHTML: cl } );