Hey all,
I have a field that contains an 'optional' passcode. Above that I have the "On/Off" radio buttons that enable/disable the field. Client-side it's no problem to have the field be disabled or enabled based upon what the user selects (via javascript below). But now I want to add the ability to 'update' the settings. so I load out of the database the users details and am trying to use the code-behind to enable or disable the text field. It does not seem to work as I would assume.
Javascript:
<script type="text/javascript">
<!--
function setPassCodeEnabled(){
document.getElementById("<%=passCodeTB.ClientID%>").disabled = false;
}
function setPassCodeDisabled(){
document.getElementById("<%=passCodeTB.ClientID%>").disabled = true;
}
//-->
</script>
This script is called from the radio buttons and works fine.
Code-Behind:
if (bIsSecure)
passCodeTB.Enabled = true;
else
passCodeTB.Enabled = false;
I am not sure why that .Enabled approach will not work, but the text box stays disabled despite me verifying that it is indeed being set to true. Can anyone help me sort this out please?
Thx,
Rob