{ field: "Accept", title: commonLib.readMessageByUserLanguage(COLUMNTITLENAME.AcceptChk), "template": "<input type=\"checkbox\" # if (checkCommentsAccept(data.Comments)) { #disabled=\"disabled\" # } # />" },{ field: "Decline", title: commonLib.readMessageByUserLanguage(COLUMNTITLENAME.DeclineChk), "template": "<input type=\"checkbox\" # if (checkCommentsDecline(data.Comments)) { #disabled=\"disabled\" # } # />" },{ field: "Item", title: commonLib.readMessageByUserLanguage(COLUMNTITLENAME.Item) },{ field: "PartID", title: commonLib.readMessageByUserLanguage(COLUMNTITLENAME.PartID) },{ field: "Description", title: commonLib.readMessageByUserLanguage(COLUMNTITLENAME.Description), width: '300px' },{ field: "SubPart", title: commonLib.readMessageByUserLanguage(COLUMNTITLENAME.SubPart) },{ field: "SubPartDescription", title: commonLib.readMessageByUserLanguage(COLUMNTITLENAME.SubPartDescription) },{ field: "BusinessPartner", title: commonLib.readMessageByUserLanguage(COLUMNTITLENAME.BusinessPartner) },{ field: "ReqDelTM", title: commonLib.readMessageByUserLanguage(COLUMNTITLENAME.ReqDelTM) },{ field: "EarDelTM", title: commonLib.readMessageByUserLanguage(COLUMNTITLENAME.EarDelTM) },{ field: "EarDelDate", title: "Ear Del Date", hidden: true },{ field: "Comments", title: commonLib.readMessageByUserLanguage(COLUMNTITLENAME.Comments) }当我点击提交按钮时,它应该检查接受复选框是否被选中,如果被选中,那么我有一些逻辑。如果拒绝复选框被选中,那么我有一些其他的逻辑。
2 回答

SMILET
TA贡献1796条经验 获得超4个赞
如果有复选框,您可能已经实现只选中单个复选框,对吗?,否则可能会选中接受和拒绝两个复选框,
假设您已经实现了单选复选框逻辑
$( "form" ).submit(function( event ) {
event.preventDefault();
if($("input[type='checkbox']:checked")[0].val() == 'Allow'){
// things to done on allowed
}else if($("input[type='checkbox']:checked")[0].val() == 'Declined'){
// things to done on declined
}else{
// rest things
}
});
您可能需要稍微更改代码,但它会根据您的需要在逻辑上工作。
添加回答
举报
0/150
提交
取消