jQuery 1.7.2 - 在IE 8中中断了selector.val()

Mr *_*ver 2 javascript jquery internet-explorer-8

我的HTML中有以下块

<div class="selection">
  <p><input name="custrecord_npsdtl_decision" id="custrecord_npsdtl_decision" type="radio" value="I am solely responsible for the decision">I am solely responsible for the decision </p>   
  <p><input name="custrecord_npsdtl_decision" id="custrecord_npsdtl_decision" type="radio" value="I am partially responsible for or influence the decision">I am partially responsible for or influence the decision </p>
  <p><input name="custrecord_npsdtl_decision" id="custrecord_npsdtl_decision" type="radio" value="I am not involved in the decision">I am not involved in the decision </p>
  <p><input name="custrecord_npsdtl_decision" id="custrecord_npsdtl_decision" type="radio" value="Don't know">Don't know </p>
</div>
Run Code Online (Sandbox Code Playgroud)

还有一个功能可以根据所选的选项检查表单进度,并使用以下代码段:

var decisionmaker = $('#custrecord_npsdtl_decision:checked').val();
if (decisionmaker == elements['customlist_nps_decision'][2] || decisionmaker == elements['customlist_nps_decision'][3]) {
  redirect();
}
Run Code Online (Sandbox Code Playgroud)

这在Chrome,Firefox中可以正常使用,但在Internet Explorer(8)中无效.做了一些检查我发现了

$('#custrecord_npsdtl_decision:checked')
Run Code Online (Sandbox Code Playgroud)

按预期返回一个对象,但在对象上调用val()会返回undefined.

我绝对不知所措.如何从IE中的广播列表中获取所选选项?

use*_*654 5

ID必须是唯一的.我很惊讶这在Chrome和Firefox中都有用.

删除id属性并按名称选择.

$('input[name="custrecord_npsdtl_decision"]:checked').val();
Run Code Online (Sandbox Code Playgroud)