autocomplete, continued

This commit is contained in:
Rolux 2010-02-18 19:54:17 +05:30
commit 966359bf99
2 changed files with 83 additions and 60 deletions

View file

@ -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"