Call .immybox()
on any input[type=text]
element, and pass in some choices.
$('#input1').immybox({ choices: [ {text: 'Alabama', value: 'AL'}, {text: 'Alaska', value: 'AK'}, ... {text: 'Wisconsin', value: 'WI'}, {text: 'Wyoming', value: 'WY'} ], defaultSelectedValue: 'LA' })
You can customize the behavior of immybox using the following options:
choices
text
and value
properties. Default: []
maxResults
50
showArrow
true
openOnClick
true
filterFn
query
as arguments and must return a function that takes choice
as argument and returns a boolean. Default function case insensitive "contains" matching.formatChoice
query
as arguments and must return a function that takes choice
as argument and returns a string (optionally containing HTML). The default formatter just returns choice.text
, underlining all parts of it that match query
.(choice, query)
. If two arguments are provided, the function will be called for each choicedefaultSelectedValue
undefined
Possible values: String
(the value of the choice; if not found in the choices array, it will act like null), null
(will tell immybox that nothing should be selected by default).