摘要:[jQuery]將新的選項option加入下拉式選單中dropdownlist,ddl
//班別+期別onblur,重新設定身分證DDL
var txtClassTermNo = $("input[id*=txtClassTermNo]"); //班別
var txtTermno = $("input[id*=txttermno]"); //期別
txtTermno.blur(function () {
var ddlIdno = $("#<%=ddlIdno.ClientID%>"); //身分證
ddlIdno.empty(); //清空下拉式選單
var objData
objData = PA.wFrmCheckData.GetIdnoData(txtClassTermNo.val(), txtTermno.val()).value;
if (objData != null) {
var aryIdno = objData.split(',');
var i;
for (i = 0; i < aryIdno.length-1; i++) {
ddlIdno.append($('
').val(aryIdno[i]).html(aryIdno[i])); } } });