0
当另一个对话框也打开时,Jquery将取消选中对话框中的单选按钮。在调试运行通过,在jQuery的源罪魁祸首就是这条线:jquery取消选择单选按钮bug
if (!eventHandle) {
elemData.handle = eventHandle = function() {
// Handle the second event of a trigger and when
// an event is called after a page has unloaded
return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
jQuery.event.handle.apply(eventHandle.elem, arguments) :
undefined;//after this line executes selected radio button is lost.
};
}
没有人知道这是为什么?
是什么原因造成这样的简化版本:
$("#editYes").click(function(){//this radio is inside a dialog
if($("#editsList").children().size()==0){
$('#editDialogDiv').dialog('open');
setDateHints();
$('#editOpen').val("true");
}
//jquery code above runs here. Upto this point the radio remains selected
});
HTML是这样的:
<div title="atitle" id="dialog1">
...
Yes<input id="editYes" type="radio" value="true" name="edits"> <!-- click this to open second dialog, but its then deselected by jquery-->
No<input id="editNo" type="radio" value="false" name="edits">
...
</div>
<div title="anothertitle" id="secondDialog">
...some content
</div>
您正在寻找jQuery源代码中的页面错误?我怀疑这是搜索的正确位置:) – Andreas
你可以发布一个你的代码的例子,这样的行为请这样吗? – ericosg
两个对话框的单选按钮是否共用同一个名称? –