Welcome again, here is one more trix to enable or disable the multiple textboxes based on the check box event.
Please write the following code in Script area of the page.
<script type="text/javascript">
function enableDisable(bEnable, textBoxID, textBoxID2)
{
document.getElementById(textBoxID).disabled = !bEnable
document.getElementById(textBoxID2).disabled = !bEnable
}
</script>
Put the controls as shown below in the Form area...
<asp:TextBox ID="t1" Text="" runat="server" />
<asp:TextBox ID="t2" Text="" runat="server" />
<asp:CheckBox ID="chk1" Checked="true" onclick="enableDisable(this.checked, 't1','t2');" runat="server" />
and let it behaves as it is...its done....
browse the page and check that out.!
0 comments:
Post a Comment