Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#CityLocal").autocompleteArray(
- [
- "Aberdeen", "Ada", "Adamsville", "Zoar" //and a million other cities...
- ],
- {
- delay:10,
- minChars:1,
- matchSubset:1,
- onItemSelect:selectItem,
- onFindValue:findValue,
- autoFill:true,
- maxItemsToShow:10
- }
- );
- $("#CityLocal").autocompleteArray(
- [
- MyBigArrayOfOptions
- ],
- {
- delay:10,
- minChars:1,
- matchSubset:1,
- onItemSelect:selectItem,
- onFindValue:findValue,
- autoFill:true,
- maxItemsToShow:10
- }
- );
- $(document).ready(function(){
- // array of option elements' values
- var optionValues = [];
- // array of option elements' text
- var optionTexts = [];
- // iterate through all option elements
- $('#sel > option').each(function() {
- // get value/text and push it into respective array
- optionValues.push($(this).val());
- optionTexts.push($(this).text());
- });
- // test with alert
- alert(optionValues);
- alert(optionTexts);
- });
- var values = jQuery.map(jQuery("#select")[0].options, function(option)
- {
- return option.value;
- });
- var texts = jQuery.map(jQuery("#select")[0].options, function(option)
- {
- return option.innerHTML;
- });
- $("#CityLocal").autocompleteArray(
- MyBigArrayOfOptions,
- {
- delay:10,
- minChars:1,
- matchSubset:1,
- onItemSelect:selectItem,
- onFindValue:findValue,
- autoFill:true,
- maxItemsToShow:10
- }
- );
- myFunction($("#my-select option"));
- myFunction($("option", theSelect));
- $("#CityLocal").autocompleteArray(
- $("option", theSelect),
- {
- delay:10,
- minChars:1,
- matchSubset:1,
- onItemSelect:selectItem,
- onFindValue:findValue,
- autoFill:true,
- maxItemsToShow:10
- }
- );
Add Comment
Please, Sign In to add comment