Here is the code snippet from my asp.net page:
<button dojotype="dijit.form.Button">
<asp:Label ID="lblClear" runat="server" meta:resourcekey="lblClearResource1" />
<script type="dojo/method" event="onClick" args="evt">
return ClearCheckBoxes('<%=clientIds.ClientID%>');
</script>
</button>
The function ClearCheckBoxes used in the code is defined as follows:
function ClearCheckBoxes(obj1) {
var chks = document.getElementsByTagName("input");
for (i = 0; i < chks.length; i++) {
if (chks[i].type == "checkbox") {
if (chks[i].checked == true) chks[i].checked = false;
}
}
document.getElementById(obj1).value = "";
document.getElementById('<%=clientsIds.ClientID %>').value = "";
return false;
}
Although this code runs smoothly on most browsers, it triggers a postback in IE8. Is there any technique to prevent this unwanted postback specifically in IE8? I have tried using return false; but with no success in stopping the postback.