javascript - jQuery combo box that fills the POST variable correctly -


i have tried several jquery combo boxes (for example the simple combobox plugin jquery) , remarkably glorified selection widgets (i.e. can select item list autocomplete, animations , whatnot) not real comboboxes allow user select list enter value not in list.

(for above mentioned plugin, if set variable invalidasvalue true sets value internally , not in field used in post in <form>, if have list of "a" "b" "c" , user enters "d", result "a" because use preselection if not match item.)

the html5/datalist feature (see demo) not usable because buggy in browsers (in firefox autocomplete-feature , show whole list, in safari not supported @ all) altough working correctly in chrome.

i want basic combobox, exists in pretty every graphics toolkit on earth since @ least 1990s:

  • an item preselected
  • the user may edit item
  • or choose item drop-down list

there many demos (including above mentioned jquery plugin) fullfill above 3 points, need:

  • whatever user has entered should appear in http-post variable

(the url-bar of browser example of widget: user may choose list, may enter url not in list)

i don't need animations, skins or similar features, in fact prefer simple solution possible.

since question tagged jquery, i'm assuming issue parsing combobox options value correctly. here's pretty basic example of how this:

fiddle

js

$(document).ready(function() {     $('select').change(function() {         alert(             $(this).children(':checked').html()         );     }); }); 

html

<select>     <option>1</option>     <option>2</option>     <option>3</option> </select> 

it sounds you're wanting have values specified on options though in case you'd use $(this).children(':checked').val().


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -