Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
192
rated 0 times [  193] [ 1]  / answers: 1 / hits: 7147  / 10 Years ago, sat, february 22, 2014, 12:00:00

I want to load ajax resonse data into dropdown list. I have one dropdown list on my page. I just want to load ajax response data which will contain list of options into dropdown list.



This is my dropdown.



<select title=Basic example id=muliSelect6 class=multipleCheckbox multiple=multiple name=example-basic6[] size=5>

</select>


I am using the following ajax script :



         $.ajax({
url: GetPerPersonData.php,
type: POST,
data: {
building: $('#muliSelect1').val(),wing:$('#muliSelect3').val()

},
success: function(data)
{
$(#muliSelect6).html('');
$(#muliSelect6).html(data);
}

});


I am getting the response as a list of options as following



<option value=yogesh>Yogesh kale</option>


But it does not get loaded in dropdown list. So please help me in getting the output correctly.


More From » php

 Answers
10

Use append instead of HTML



 $('#multiSelect6').append(data);

[#47498] Friday, February 21, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
gianni

Total Points: 307
Total Questions: 104
Total Answers: 96

Location: South Georgia
Member since Sun, Aug 8, 2021
3 Years ago
;