如何将值设置为另一个组合框 [英] how to set the value to another Combo box

查看:80
本文介绍了如何将值设置为另一个组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Team,



我的代码如下。



Hello Team,

I have the Code as follows.

function GetDisplayQCID() {
            debugger;
            $.ajax({
                url: 'QCAllocation.aspx/GetDisplayQCID',
                type: 'POST',
                contentType: 'application/json; charset=utf-8',
                dataType: "json",
                success: function (result) {
                    debugger;
                    if (result.d != '') {
                        if (result.d != '' && result.d != null) {
                            DisplayQCIDList = JSON.parse(result.d);

                            var drawRow = function (qcIDs) {
                                var dropdown = document.getElementById('qcSelect');
                                for (var i = 0; i < qcIDs.length; i++) {
                                    var opt = document.createElement('option');
                                    opt.innerHTML = qcIDs[i].NetworkId;
                                    dropdown.appendChild(opt);
                                }
                            }

                            drawRow(DisplayQCIDList);
                            manageOverlay(false);
                        }
                    }

                },
                error: function (error) {
                    manageOverlay(false);
                    alert(error.responseText);
                },
                async: false
            })
        };





如下所示



As In below

var dropdown = document.getElementById('qcSelect');



我在qcSelect组合框中获取值。但是如果我想在其他组合框中获得相同的价值怎么可能。



请指南。

谢谢

Harshal


I am getting the value in qcSelect Combo box. But if i want the same value in other Combo box How it possible.

Please Guide.
Thanks
Harshal

推荐答案

.ajax({
url:' QCAllocation.aspx / GetDisplayQCID'
类型:' POST'
contentType:' application / json; charset = utf-8'
dataType: json
成功:函数(结果){
debugger;
if (result.d!= ' '){
if (result.d!= ' '&& result.d!= null ){
DisplayQCIDList = JSON.parse(result.d);

var drawRow = function(qcIDs){
var 下拉列表= document.getElementById(' qcSelect');
for var i = 0 ; i < qcIDs.length; i ++){
var opt = document。 createElement(' option');
opt.innerHTML = qcIDs [i] .NetworkId;
dropdown.appendChild(opt);
}
}

drawRow(DisplayQCIDList);
manageOverlay( false );
}
}

},
错误:函数(错误){
manageOverlay( false );
alert(error.responseText);
},
async false
})
};
.ajax({ url: 'QCAllocation.aspx/GetDisplayQCID', type: 'POST', contentType: 'application/json; charset=utf-8', dataType: "json", success: function (result) { debugger; if (result.d != '') { if (result.d != '' && result.d != null) { DisplayQCIDList = JSON.parse(result.d); var drawRow = function (qcIDs) { var dropdown = document.getElementById('qcSelect'); for (var i = 0; i < qcIDs.length; i++) { var opt = document.createElement('option'); opt.innerHTML = qcIDs[i].NetworkId; dropdown.appendChild(opt); } } drawRow(DisplayQCIDList); manageOverlay(false); } } }, error: function (error) { manageOverlay(false); alert(error.responseText); }, async: false }) };





如下所示



As In below

var dropdown = document.getElementById('qcSelect');



我在qcSelect组合框中获取值。但是如果我想在其他组合框中获得相同的价值怎么可能。



请指南。

谢谢

Harshal


I am getting the value in qcSelect Combo box. But if i want the same value in other Combo box How it possible.

Please Guide.
Thanks
Harshal


请看这个链接...

将所有选项复制到另一个选择元素
Please look at this link...
Copy all Options to another Select element


这篇关于如何将值设置为另一个组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆