var tlength = $("#tSaleNodeListlength").val();
for (var i=0; i <tlength; i++) {
var q = $("#nodeOrderList_" + i +"").val();
if ($("#nodeIdList_"+i+"").is(':checked')) {
if (typeof (q)!="undefined"&&q!=""&&q!=null) {
//两个都有值通过
} else {
alert("节点有节点顺序不能为空");
}
} else {
if (typeof (q)!="undefined"&&q!=""&&q!=null) {
// 都为空通过
alert("节点不能为空");
$("#c-nodeIdList_"+i+"").html("节点不能为空");
}else{
// 都为空通过
}
}
for (var i=0; i <tlength; i++) {
var q = $("#nodeOrderList_" + i +"").val();
if ($("#nodeIdList_"+i+"").is(':checked')) {
if (typeof (q)!="undefined"&&q!=""&&q!=null) {
//两个都有值通过
} else {
alert("节点有节点顺序不能为空");
}
} else {
if (typeof (q)!="undefined"&&q!=""&&q!=null) {
// 都为空通过
alert("节点不能为空");
$("#c-nodeIdList_"+i+"").html("节点不能为空");
}else{
// 都为空通过
}
}
}
为空判断--------typeof (q)!="undefined"&&q!=""&&q!=null