HTML select UI enhancer jQuery plugin
Jquery plugin to make html select inputs easier to use (UI enhancements).
html
`
Call legTechSelect() on the jquery selector of your select(s).
`javascript
$("#mySelect").legTechSelect(); or $(".allMySelects").legTechSelect();
It will automatically format the UI if the select is a single or multiple. It will ignore non-select elements. Options that are set to "selected" will be pre-selected, of course.
`html
or
`
External data for options list
You can specify a remote source when initializing the select. Legtech-select will make an AJAX get request to pull in the list of options.
`javascript
$("#mySelect").legTechSelect("url to data");
`
The format must be an array of JSON objects with the following properties/values:
`javascript
{ value: "value of option", text: "Text to display", selected: true/false }
`
The selected property can be omitted and defaults to false.
Example
`javascript
[{ value: "US", text: "United States", selected: true },{ value: "CA", text: "Canada" }]
`
Refreshing the List
If you update the dropdown value list you must call refresh to update the UI. Note that this will clear any selected values.
`javascript
$("#mySelect").legTechSelect("refresh");
``