You have forgotten to concatenate the real value: $('#birth_month option[value="'+data.month+'"]').prop('selected', true);. ... <看更多>
Search
Search
You have forgotten to concatenate the real value: $('#birth_month option[value="'+data.month+'"]').prop('selected', true);. ... <看更多>
jquerydropdownchange #selecteddropdownvalue #jqueryhtmlselectoptionget the selected value from the ... ... <看更多>
<select> <option value="0" data-foo="bar">option one</option> ... </select> ... Select2 uses jQuery's $.ajax function to execute the remote call by default. ... <看更多>
Everything works perfectly, EXCEPT when I choose an option in the first select and then try to use the second select (AJAX loaded options) ... ... <看更多>
This is important: selected="selected" for each option you want to preload. Here is my working code: HTML: <select class="form-control select2- ... ... <看更多>