【发布时间】:2013-07-19 02:32:10
【问题描述】:
我想在保存时验证 Contact Type 值何时具有 True Primary,以便只有一个 Contact Type 值是 Primary,
我如何使用 jquery 或 Javascript 处理它:(
谢谢
var row = obj.closest("tr").find("input[name=workerId]").val();
var contactValue = obj.closest("tr").find("input[name=contactValue]").val();
var contactType = obj.closest("tr").find("input[name=contactType]").val();
var isPrimary = obj.closest("tr").find("input[name=isPrimary]").val();
// get the value of the checkbox in edit modal window
if (isPrimary === 'true') {
$('#chkEditWorkerIsPrimary').attr('checked', 'checked');
} else {
$('#chkEditWorkerIsPrimary').removeAttr('checked');
}
【问题讨论】:
标签: c# javascript jquery asp.net-mvc asp.net-mvc-3