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

  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, Sep 27, 2009
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.