c# - postback on click for type ahead drop down -
i have type head drop down list created. had turn autopostback false because otherwise post user typing. want poast when use has made selection.
i don't wanna use submit button or that. long story, trust me it's not solution situation.
in javascript type ahead when use clicks enter post back. work great.
however whast when user click mouse? use onblur event postback. requires clicking outside of drop down list.
i want postback happen when click new item. postback when itemchanged, if changed clicking on it.
any ideas???
providing using date version of type ahead, library comes set of callback functions available here.
to execute callback, pass in via bind method when initialize type ahead. example code:
// attach type-ahead class $autocomplete.typeahead({ hint: true, highlight: true, minlength: 1 }, { displaykey: 'value', source: substringmatcher($autocompletedata) }).bind("typeahead:selected", function (obj, datum, name) { console.log(obj, datum, name); });
the .bind method on end execute when user either clicks option or hits return key on option. replace console.log entry whatever want do, i.e target submit button trigger click.
Comments
Post a Comment