我正在编写SharePoint 2013编辑ASPX表单。现在我有了以下复选框:-
<span title=“yes”class=“ms radiotext”>
<input id=“updateOrder_0e0052d6-9924-4774-b50d-d7ef364d744a_multichoiceoption_0”required=“”type=“checkbox”>
<label for=“更新订单”是</label>
</span>

现在,我希望在某些情况下根据需要设置此复选框,这样用户就不能提交表单,除非他们选中此复选框。所以我写了下面的javascript:-
var orderstatus0=$('select[id^=“orderstatus”]').val();
if(orderStatus0=“已开票”)
{
$('input[id^=“updateOrder_“]”)。必需;
var x=document.getElementByID('updateOrder_0e0052d6-9924-4774-b50d-d7ef364d744a_multichoiceoption_0')。必需;
document.getElementByID('updateOrder_0e0052d6-9924-4774-b50d-d7ef364d744a_multichoiceoption_0').required=true;
警报(x);
}
但目前不会应用任何验证,即使在警报内,我也希望得到true,但我得到的是false。那么,有人能就此提出建议吗?
谢谢

现在,我希望在某些情况下根据需要设置此复选框,这样用户就不能提交表单,除非他们选中此复选框。所以我写了以下javascript:
var orderstatus0 = $('select[id^="OrderStatus_"]').val();
if (orderstatus0 == "Invoiced")
{
$('input[id^="UpdateOrder_"]').required;
var x = document.getElementById('UpdateOrder_0e0052d6-9924-4774-b50d-d7ef364d744a_MultiChoiceOption_0').required;
document.getElementById('UpdateOrder_0e0052d6-9924-4774-b50d-d7ef364d744a_MultiChoiceOption_0').required= true;
alert(x);
}
但目前不会应用任何验证,即使是在我期望获得的警报中true但是我得到了false…那么,有人能就此提出建议吗?
谢谢