Jquery SharePoint REST API:复选框组和GET/POST的所有值
使用SharePoint REST API,有一个引导/HTML表单,其中有大约20个问题,每个问题都有自己的一组复选框,我正在尝试从“选中”框中获取和发布值。我可以得到一个组的一个复选框值来发布,但不是全部 我还不确定如何在get上选中复选框,例如,当用户打开现有记录的表单时,应该选中正确的复选框 我试过的Jquery SharePoint REST API:复选框组和GET/POST的所有值,jquery,sharepoint,sharepoint-rest-api,Jquery,Sharepoint,Sharepoint Rest Api,使用SharePoint REST API,有一个引导/HTML表单,其中有大约20个问题,每个问题都有自己的一组复选框,我正在尝试从“选中”框中获取和发布值。我可以得到一个组的一个复选框值来发布,但不是全部 我还不确定如何在get上选中复选框,例如,当用户打开现有记录的表单时,应该选中正确的复选框 我试过的 var checkedV = $('input[name="q1error"]:checked').map(function() { return $(this).value(); }).
var checkedV = $('input[name="q1error"]:checked').map(function() {
return $(this).value();
}).get();
'q1e': $('input:checkbox[name="q1error"]:checked').val()
'q1e':$('input[name="q1error"]').val(arrayValues)
HTML示例
<div class="form-group my-2">
<label>1. Some question?</label>
<div class="custom-control custom-radio">
<input type="radio" class="custom-control-input qOne" id="q1y" name="q1" value="Yes"></input>
<label class="custom-control-label" for="q1y">Yes</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" class="custom-control-input qOne" id="q1n" name="q1" value="No"></input>
<label class="custom-control-label" for="q1n">No</label>
</div>
<div class="errorAll errorQone">
<div class="mt-1 mb-1 qOneSub">If no, then identify which issues below</div>
<div class="custom-control custom-checkbox mb-1 qOneSub">
<input type="checkbox" class="custom-control-input" id="errorQ1a" name="q1error" value="a"></input>
<label class="custom-control-label" for="errorQ1a">a</label>
</div>
<div class="custom-control custom-checkbox mb-1 qOneSub ">
<input type="checkbox" class="custom-control-input" id="errorQ1b" name="q1error" value="b"></input>
<label class="custom-control-label" for="errorQ1b">b</label>
</div>
</div>
</div>
1.有什么问题吗?
对
不
如果没有,请确定以下哪些问题
A.
B