Radiobutton w/Javascript to enable a textbox.

Discussion in 'ASP .Net Web Controls' started by Mr.Magic, Sep 22, 2009.

  1. Mr.Magic

    Mr.Magic Guest

    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.
    Mr.Magic, Sep 22, 2009
    #1
    1. Advertising

  2. 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

    http://www.nathansokalski.com/

    "Mr.Magic" <> wrote in message
    news:...
    >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, Sep 27, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason
    Replies:
    3
    Views:
    50,495
    Jason
    Sep 14, 2004
  2. Patrick
    Replies:
    1
    Views:
    634
  3. Daisaku
    Replies:
    0
    Views:
    203
    Daisaku
    Nov 20, 2003
  4. Replies:
    2
    Views:
    1,114
  5. kamalesh

    how to Enable/Disable textbox dynamically

    kamalesh, Aug 4, 2007, in forum: Javascript
    Replies:
    9
    Views:
    245
    Bart Van der Donck
    Aug 5, 2007
Loading...

Share This Page