How to fill a DropDown using Jquery Ajax Call?

前端 未结 4 738
南方客
南方客 2020-12-09 22:20

I have a WebMethod which gets data that I want to fill DropDown with in a DataSet. Currently I am filling the dropdown using a hardcoded object. But I want to replace this

4条回答
  •  臣服心动
    2020-12-09 22:35

     var theDropDown = document.getElementById("myDropDownLisTId");
                    theDropDown.length = 0;
                    $.each(items, function (key, value) {
    
                        $("#myDropDownLisTId").append($("").val(value.PKId).html(value.SubDesc));
    

    here "SubDesc",PKId describes the value getting out of Database., u need to separate your value from dataset.

提交回复
热议问题