Hi,
I am creating a page in asp.net that has a checkbox and a textbox. When the checkbox is checked I want the textbox to become active and show text. If the checkbox is unchecked, I would like the text box to become disabled and show no text.
Is this possible to do via javascript? I would like to handle it all client side.
Thanks,
JLC
This is possible with JavaScript.
Just remember that JavaScript works on Html objects, not ASP objects.
You'll need to know the ClientId of the Textbox control so that you can access it using yur JavaScript....
So basically you're going to write a JavaScript function that handles the onClick event of the check box and is passed the name (clientID) of the textbox.... then enable the textbox or disable it depending on the value of the check box by using the getElementByID() javascript method.
Take a look at the .NET article
How to check if a textbox contains a number to get a better idea of how to use JavaScript in your .NET project.
-Frinny