问题是没有回发。我注意到,如果我返回真的,那就不是这样了。但是有非确定性结果,所以我不知所措。 任何帮助表示赞赏!
<DropDownList ID="ddlS1" runat="server" onclick = "checkHighDegreeCompliance(this, 1);" SelectedIndexChanged = "ddlS1_SelectedIndexChanged" AutoPostBack="true" >
这是加载后实际页面上的标记
<select name="rptrSection1$ctl00$rptrSection2$ctl00$ddlS2" class="DDLSelector2 SDropDown IsNormal" id="rptrSection1_ctl00_rptrSection2_ctl00_ddlS2" style="width: 200px;" onchange="checkHighDegreeCompliance(this, 2);setTimeout('__doPostBack(\'rptrSection1$ctl00$rptrSection2$ctl00$ddlS2\',\'\')', 0)">
这是javascript
function checkHighDegreeCompliance(obj, sectionNum)
{
var parDdl = $(obj);
var parCompLev = parDdl.attr('selectedIndex');
var pnlDiv = parDdl.parents('.Section');
var ddls = pnlDiv.find('.DDLSelector' + (sectionNum + 1));
ddls.each(function ()
{
var childDDL = $(this);
var childComLev = childDDL.attr('selectedIndex');
if (childComLev > parCompLev)
{
parDdl.attr('selectedIndex', childComLev);
}
if (sectionNum < 4)
{
checkHighDegreeCompliance(childDDL, ++sectionNum);
}
});
}
答案 0 :(得分:0)
在return
事件
onclick
关键字进行尝试
<DropDownList ID="ddlS1" runat="server" onclick = "return checkHighDegreeCompliance(this, 1);" SelectedIndexChanged = "ddlS1_SelectedIndexChanged" AutoPostBack="true" >
如果不起作用,请告诉我。