Radio buttons Enable/Disable textboxes

Hi,  I have a asp.net webform with four radio buttons and four associated textboxes.   OnLoad the first radio button and textbox are enabled.  

What I'd like to be able to do is this....  

When a user select another radio button, the textbox associated with that radio button (found in the same row) is enabled and all other textboxes are disabled?  Can you please provide me a JQuery or JavaScript code that will achieve this functionality?

My Table, radio buttons and textboxes are below.  THANKS!

<table>
                <tr>
                    <td>
                        <asp:RadioButton ID="rbtnSpecNumber" runat="server" Text="Spec #" Checked="True" />
                    </td>
                    <td>
                        <asp:TextBox ID="tbSpecNumber" runat="server" Enabled="True"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:RadioButton ID="rbtnClient" runat="server" Text="Client" />
                    </td>
                    <td>
                        <asp:TextBox ID="tbClient" runat="server" Enabled="false"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:RadioButton ID="rbtnShow" runat="server" Text="Show"/>
                    </td>
                    <td>
                        <asp:TextBox ID="tbShow" runat="server" Enabled="false"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:RadioButton ID="rbtnAccountExec" runat="server" Text="Account Exec"/>
                    </td>
                    <td>
                        <asp:TextBox ID="tbAccountExec" runat="server" Enabled="false"></asp:TextBox>
                    </td>
                </tr>
            </table>

Open in new window

cdemott33Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rainer JeschorCommented:
Hi,
something like this?
$(document).ready(function () {
    $("input:radio").click(function(){
        var $table = $(this).closest("table");
        $("input:text", $table).prop( "disabled", true );
        $("input:radio",$table).prop("checked","");
        $(this).prop("checked","checked");
        $(this).closest("tr").find("input:text").prop("disabled", false);
    });
});

Open in new window

Live (plain HTML) sample:
http://jsfiddle.net/EE_RainerJ/70ekhavt/
HTH
Rainer
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cdemott33Author Commented:
Works PERFECTLY!  Thanks Rainer!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.