如何在下拉更改功能中选择时间值。 [英] How to select the value for number of time in Drop Down on change function.
本文介绍了如何在下拉更改功能中选择时间值。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HEllo团队,
我有如下输入:
HEllo Team,
I have a input as follows:
<pre lang="xml"><td>
<select id="allocateToSelect" class="combo150">
</select>
</td>
I am inserting the DropDown option value as follows:
<pre>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 dropdownQC = document.getElementById('qcSelect');*/ //for append to another DropDown.
var dropdownQC = document.getElementById('allocateToSelect');
/*var dropdownAllocateToQC = document.getElementById('allocateToSelect');
dropdownAllocateToQC.innerHTML = dropdownAllocateToQC.innerHTML + dropdownQC.innerHTML;*/
var opt = document.createElement('option');
opt.innerHTML = '';
dropdownQC.appendChild(opt);
for (var i = 0; i < qcIDs.length; i++) {
opt = document.createElement('option');
opt.value = qcIDs[i].Id; // it will give the ID through which we can find the value which present in DropDown.
opt.innerHTML = qcIDs[i].NetworkId;
dropdownQC.appendChild(opt);
}
}
drawRow(DisplayQCIDList);
/*$('#qcSelect option').clone().appendTo('#allocateToSelect');*/ //for append to another DropDown.
manageOverlay(false);
}
}
},
error: function (error) {
manageOverlay(false);
alert(error.responseText);
},
async: false
})
};
我有Jquery中的函数如下:
I have the Function in Jquery as follows:
&lt;pre lang=&quot;cs&quot;&gt;$(&amp;#39;#allocateToSelect&amp;#39;).change(function () {
debugger;
$(&amp;quot;#allocateToSelect option:selected&amp;quot;).val();
GetQCCount();
});&lt;/pre&gt;</pre></pre>
我在下拉列表中选择相同值时遇到问题。第一次接到电话在更改功能,但第二次,当我选择相同的值,它无法接听电话。请指导我。如何解决它请告诉我。
谢谢
Harshal
I am facing problem on selecting the Same value in dropdown .At first time it get call on change function but on second time when i select the same value it cannot get call.Please guide me .How to get it solve please tell me.
Thanks
Harshal
推荐答案
.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!=''& amp;& amp; result.d!= null){
DisplayQCIDList = JSON.parse(result.d);
var drawRow = function(qcIDs){
/ * var dropdownQC = document.getElementById('qcSelect'); * / //用于附加到另一个DropDown。
var dropdownQC = document.getElementById('allocateToSelect');
/ * var dropdownAllocateToQC = document.getElementById('allocateToSelect');
dropdownAllocateToQC.innerHTML = dropdownAllocateToQC.innerHTML + dropdownQC.innerHTML; * /
var opt = document.createElement('option');
opt.innerHTML ='';
dropdownQC.appendChild(opt);
for(var i = 0; i & lt; qcIDs.length; i ++){
opt = document.createElement ('选项');
opt.value = qcIDs [i] .Id; //它将提供ID,通过该ID我们可以找到DropDown中存在的值。
opt.innerHTML = qcIDs [i] .NetworkId;
dropdownQC.appendChild(opt);
}
}
drawRow(DisplayQCIDList);
/ *
.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 dropdownQC = document.getElementById('qcSelect');*/ //for append to another DropDown. var dropdownQC = document.getElementById('allocateToSelect'); /*var dropdownAllocateToQC = document.getElementById('allocateToSelect'); dropdownAllocateToQC.innerHTML = dropdownAllocateToQC.innerHTML + dropdownQC.innerHTML;*/ var opt = document.createElement('option'); opt.innerHTML = ''; dropdownQC.appendChild(opt); for (var i = 0; i < qcIDs.length; i++) { opt = document.createElement('option'); opt.value = qcIDs[i].Id; // it will give the ID through which we can find the value which present in DropDown. opt.innerHTML = qcIDs[i].NetworkId; dropdownQC.appendChild(opt); } } drawRow(DisplayQCIDList); /*
('#qcSelect option')。clone()。appendTo('#allocateToSelect'); * / //用于附加到另一个DropDown。
manageOverlay(false);
}
}
},
错误:函数(错误){
manageOverlay(false);
alert(error.responseText);
},
async:false
})
};
('#qcSelect option').clone().appendTo('#allocateToSelect');*/ //for append to another DropDown. manageOverlay(false); } } }, error: function (error) { manageOverlay(false); alert(error.responseText); }, async: false }) };
我有Jquery中的函数如下:
I have the Function in Jquery as follows:
&lt;pre lang=&quot;cs&quot;&gt;
(& amp; amp;#39;#allocateToSelect& amp; amp;#39;)。change(function(){
debugger;
(&amp;#39;#allocateToSelect&amp;#39;).change(function () { debugger;
这篇关于如何在下拉更改功能中选择时间值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文