.bind()
.unbind()
.css()
.hasclass()
.removeclass
.parent()
.children()
.html()
.hide()
.show()
.attr()
.val()
.find()
//给所有必填框添加框添加事件
$('.bs').each(function (obj) {
$(this).unbind().bind('blur', function () {
BSCheck(this);
})
})
$('.tbodyclose').each(function () {
$(this).css("display", "none");
});
//当先选择后面控件后,把金额设置成必填,把其它控件设置成非必填;把需要必填的字段设置为必填
if ($(obj).attr("checked") == true) {
$(obj).parent().children().each(function (obj) {
if ($(this).hasClass('input_money') == true) {
$(this).addClass("Required0");
}
if ($(this).hasClass('ds') == true) {
$(this).removeClass('Required');
}
if ($(this).hasClass('dsT') == true) {
$(this).removeClass('Required');
}
if ($(this).hasClass("fjbs") == true) {
$(this).addClass("Required");
}
if ($(this).hasClass("bs") == true) {
$(this).addClass("Required");
}
})
}
- .html() .hide() .show() .attr() .val() 的使用
//根据交通方法,显示每种交通方式可使用的等级
function SetKZ(item) {
var select1;
JSMDXCBUS($(item).attr("id"));//当交通工具修改后,重算
$(item).parent().children().each(function (allitem) {
if ($(this).attr("name") == " - ") {
select1 = $(this);
}
});
if ($(item).val() == "飞机") {
$(select1).attr("class", "Required inputText");
$(select1).show();
$(select1).html('<option value="请选择">请选择</option><option value="头等舱">头等舱</option><option value="商务舱">商务舱</option><option value="经济舱">经济舱</option>');
}
else if ($(item).val() == "火车") {
$(select1).attr("class", "Required inputText");
$(select1).show();
$(select1).html('<option value="请选择">请选择</option><option value="软卧">软卧</option><option value="硬卧">硬卧</option><option value="软座">软座</option><option value="硬座">硬座</option><option value="一等座">一等座</option><option value="二等座">二等座</option>');
}
else if ($(item).val() == "轮船") {
$(select1).attr("class", "Required inputText");
$(select1).show();
$(select1).html('<option value="请选择">请选择</option><option value="一等舱">一等舱</option><option value="二等舱">二等舱</option><option value="三等舱">三等舱</option>');
}
else {
$(select1).removeClass("Required");
$(select1).hide();
$(select1).val("");
$(select1).html("");
}
}
var rownumber = $("#scgy_AddRowTable").find("tr").length;
if (Number(rownumber) == 1) {
return "请添加项目!";
}