Hi everyone ! my problem is , i tried to disable a textbox control by writing this code "textbox1.visib le =false" inside the checkbox checked event ! but the event didnt fire ! Kindly get me some alternative idea! or plz tell me can i use any other control to do this operation !
Hiding a textbox while checking a check box
Collapse
X
-
Dear Sir/mam !Originally posted by acoderDo you want to hide or disable the text box?
You have already been shown how to hide. visibility should be set to "hidden", not 'false'.
To disable instead of hide, use the disabled property and set it to true.
The solution for which i needed is, i need to hide a dropdown list by overlapping the textbox over it while checking the check box(in asp.net vs 05), but the check box's check event doesnt responds or fires when i check the box ! watz the solution for this ! Kindly help me !Comment
-
[HTML]Originally posted by hellbossHi everyone ! my problem is , i tried to disable a textbox control by writing this code "textbox1.visib le =false" inside the checkbox checked event ! but the event didnt fire ! Kindly get me some alternative idea! or plz tell me can i use any other control to do this operation !
<html>
<script>
function fun1()
{
if(document.for ms[0].testcheck.chec ked == true)
{
document.forms[0].username.style .visibility='hi dden';
}
else
{
document.forms[0].username.style .visibility='vi sible';
}
}
</script>
<body>
<form>
checkbox testing example.
<input type="text" name="username" value="Test">
<input type="checkbox" name="testcheck " onclick="fun1() ">
</form>
</body>
</html>
[/HTML]Comment
Comment