Link to home
Start Free TrialLog in
Avatar of cdemott33
cdemott33Flag for United States of America

asked on

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

ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cdemott33

ASKER

Works PERFECTLY!  Thanks Rainer!