Radiobutton w/Javascript to enable a textbox.



I have a radiobutton that when it's checked, I want to make a text box
become enabled so the user can enter a value.

How do I do this? Isn't there something about having to pass in the correct
client name because it won't be the name I give the textbox in the code.

TIA - Jeff.



Nathan Sokalski

To get the id that the control will have on the client when the html is
generated you need to use the ClientID property of the server-side control.
Because you need to get the ClientID using server-side code, you need to
generate the JavaScript server-side as well. This does not need to be
complicated, you can make it as simple as using some simple basic String
manipulation to put the value of the ClientID property in the correct place
in your JavaScript code. Hopefully this helps.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question