Friday, 15 May 2015

javascript - Make ajax request and success data show in id <select></select> part -


.. My HTML page contains the same multiple selection drop-downs. Something like this -

  & lt; Select ID = "box" data placeholder = "Select from available options." Class = "select-student-select" name = "class" multiple style = "width: 310px;" Tabindex = "4" & gt; & Lt; / Select & gt;  

In this select drop down, I can show success data by requesting an Ajax and sending & lt; Option & gt; & Lt; / Option & gt; I'm trying to print.

When I used a simple & lt; without using the selected style Select & gt; & Lt; / Select & gt; , then I can see the options there. But when I use the select style select (multiple selection), the option does not show.

  document.getElementById ("box"). InnerHTML = Data;  

I am doing something like this. Please, help me that when I used that chosen effect, then why do not I see it?

  $ (document) .ready (function () {$ ('# customer'). Change (function () {var id = $ (this) .val (); $ .aex ({Type: "GET", url: '../ folder / page 1.php', data: "middle =" + id, success: work (data) {warning (data); document getElementById ("box" ). InnerHTML = Data;}})}}}}};  

HTML should be chosen after loading on page ajax. This question has been answered.


No comments:

Post a Comment