javascript - Make dropdown multi-select -
I have 2 dropdowns and one of them (the second one) is dynamic in such a way that its value changes according to the option Selected in first dropdown
JSFiddle Result:
Can anyone show me how can I make another dropdown to select each other? I'm really green in Jquery and HTML.
JSFild:
& lt; Select ID = "range_oder_cite" & gt; & Lt; / Select & gt; & Lt; Select ID = "auswahl" & gt; & Lt; / Select & gt; Var data = {"category": ["craft", "starship", "insurance", "risk",], "site": ["http://jsfiddle.net/tony089/pgbw56vb/2/", " Https://stackoverflow.com/users/login?returnurl=%2fquestions%2fask "],}; Var $ kategorien = $ ("# kategorie_oder_seite") ("Change", function () {var seiten = $ .map (data [this.value], function (seite) {return $ ("& lt; option / & gt;"). Text (seat);}) ; $ ("# Auswahl") blank (). Append (sitten);}); (Different categories in data) {$ ("& lt; option />").text(kategorie).appendTo($kategorien); } $ Kategorien.change ();
Thanks in advance.
You can select multiple of the selection tag
attribute and its value to multiple
Also remember that the name
set the asset to an array so that you can send multiple values through this select
control. E.g.
& lt; Multiple = "multiple" id = "category_oder_seite" name = "check []" & gt; & Lt; / Select & gt;
JSField:
Comments
Post a Comment