javascript - mixing my jquery with an onclick event also tied to a SelectedIndexChanged event -
the issue no post occurs. noticed if returned true not be case .. there non-deterministic results @ loss. appreciated!
<dropdownlist id="ddls1" runat="server" onclick = "checkhighdegreecompliance(this, 1);" selectedindexchanged = "ddls1_selectedindexchanged" autopostback="true" >
here markup on actual page after loading
<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)">
here 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); } }); }
try return
keyword before onclick
event
<dropdownlist id="ddls1" runat="server" onclick = "return checkhighdegreecompliance(this, 1);" selectedindexchanged = "ddls1_selectedindexchanged" autopostback="true" >
let me know if not worked.
Comments
Post a Comment