Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   Radiobutton w/Javascript to enable a textbox. (http://www.velocityreviews.com/forums/t781100-radiobutton-w-javascript-to-enable-a-textbox.html)

Mr.Magic 09-22-2009 12:48 PM

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 09-27-2009 04:19 PM

Re: Radiobutton w/Javascript to enable a textbox.
 
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.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

"Mr.Magic" <Mufasa@NoWhere.Com> wrote in message
news:Od0hMM4OKHA.1372@TK2MSFTNGP02.phx.gbl...
>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.
>
>





All times are GMT. The time now is 04:28 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.