I am using the below code which is working fine in chrome, IE but its not working in firefox. Can anybody alter this code such as to work with firefox also.
function DisableKeyboardOnMe() {
if(check1.checked == true) {
} else if(check1.checked == false) {
return false;
}
}
</script>
<asp:CheckBox ID="check1" runat="server"/>
<asp:TextBox ID="tbxt1" runat="server" MaxLength="6" onkeypress="return DisableKeyboardOnMe();" Width="200" TextMode="Password" autocomplete="off" onfocus="getFocus(this.id);"></asp:TextBox>
You can use DOM element IDs as JS variables.
You need to call
document.getElementById('<%= check1.ClientID %>)`However, you actually want to use the
readonlyproperty instead.