forked from 0x2620/oxjs
autocomplete, continued
This commit is contained in:
parent
bf73d4f181
commit
966359bf99
2 changed files with 83 additions and 60 deletions
|
|
@ -343,12 +343,16 @@
|
|||
"South Carolina", "South Dakota", "Tennessee", "Texas", "Utah",
|
||||
"Vermont", "Virginia", "Washington", "West Virgina", "Wisconsin",
|
||||
"Wyoming"
|
||||
],
|
||||
$.each(states, function(i, state) {
|
||||
if (Ox.startsWith(state.toLowerCase(), value)) {
|
||||
items.push(state);
|
||||
}
|
||||
});
|
||||
];
|
||||
if (value === "") {
|
||||
items = states;
|
||||
} else {
|
||||
$.each(states, function(i, state) {
|
||||
if (state.toLowerCase().indexOf(value) > -1) {
|
||||
items.push(state);
|
||||
}
|
||||
});
|
||||
}
|
||||
callback(items);
|
||||
},
|
||||
placeholder: "State"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue