我有一个“计算器”,它在您执行计算之前选择了两个单选按钮(link to form)。 要查看我的问题,请选择标有“N-12”的单选按钮[进行测试,我们只需将“5”放入“Slope”中,将“30”放入“Pipe Size”并选择“N-12”,然后计算] ,然后执行计算一切都很好,直到你打印。 因为人们想要获得计算的纸质副本,所以他们经常在完成后打印计算出的表格,但是如果您选择了“N-12”并打印了页面,则会选择“单壁”单选按钮进行打印。 我已经读过这是一个错误,你可以强迫IE8识别带有JS的已检查单选按钮,这就是我所做的,但它不能用于IE6& 7。 这是我用来纠正IE8这个问题的JS:
function toggleRadioCheckbox(el) {
if ( el.getAttribute('checked') != 'checked' ) {
el.setAttribute('checked','checked');
}
else {
el.removeAttribute("checked");
}
}
有没有人知道我需要做些什么来纠正这个IE6和7。
答案 0 :(得分:1)
是。试试这个(需要jQuery)解决方案:
// We want the change event to trigger when the radio buttons are clicked.
// Normally IE doesn't
// trigger change until the radio button has lost focus.
// Fake it with this click handler
$('input:radio').click(function() {
this.blur();
this.focus();
});