Click here to Skip to main content
15,306,032 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
I have tried looking everywhere for an answer that works and decided to ask my question here.

I am using a Radiobuttonlist that has three buttons as follows:

XML
<asp:RadioButtonList ID="rblResolution" runat="server" Font-Size="X-Small" RepeatDirection="Horizontal" BorderStyle="Outset" Width="290px">
            <asp:ListItem Value="Judgement Filed" >Judgement Filed</asp:ListItem>
            <asp:ListItem Value="To Team" >To Team</asp:ListItem>
            <asp:ListItem Value="Other">Other</asp:ListItem>
        </asp:RadioButtonList>



I have been asked to add a comment field when Other is selected so the user can enter a resolution other than the two options. The comment entered would replace the Value "Other" stored in the table.

I can add a comment textbox and handle this in the .cs but there is an issue with placing the comment textbox next to the Radiobuttonlist, can't be done cleanly. It gets moved to below the Radiobuttonlist box. There is already a Resolution Date there that could not be placed next to the Radiobuttonlist box.

Is there a way to do this within the Radiobuttonlist section? I see this used in surveys and think there has to be a way.

Thanx in advance and I hope this makes sense.
Posted
Updated 20-Apr-11 20:57pm
v3
Comments
Orcun Iyigun 20-Apr-11 19:33pm
   
Not the best option but I just want to suggest. You may use a popup window with the textbox and a button. let user enter the value to the textbox and update the value and name of the radio button from teh codebehind.
Monjurul Habib 21-Apr-11 2:57am
   
code block edited.

1 solution

here's a quite quick and quite dirty idea

XML
<table>
    <tr>
    <td>
    <asp:RadioButtonList ID="rblResolution" runat="server" Font-Size="X-Small" RepeatDirection="Horizontal" BorderStyle="Outset" Width="290px">
        <asp:ListItem Value="Judgement Filed" >Judgement Filed</asp:ListItem>
        <asp:ListItem Value="To Team" >To Team</asp:ListItem>
        <asp:ListItem Value="Other">Other</asp:ListItem>
    </asp:RadioButtonList>
    </td>
    <td><asp:TextBox id="yourBelovedTextbox" runat="server"></asp:TextBox></td>
    </tr>
    </table>




or maybe better for you the following to preserve format and border style as you previously had

XML
<asp:Table runat="server" BorderStyle="Outset" Width="400px" Font-Size="X-Small">
<asp:TableRow runat="server">
<asp:TableCell runat="server">
<asp:RadioButtonList ID="rblResolution" runat="server"  RepeatDirection="Horizontal" >
    <asp:ListItem Value="Judgement Filed" >Judgement Filed</asp:ListItem>
    <asp:ListItem Value="To Team" >To Team</asp:ListItem>
    <asp:ListItem Value="Other">Other</asp:ListItem>
</asp:RadioButtonList>
</asp:TableCell>
<asp:TableCell ID="TableCell1" runat="server"><asp:TextBox id="yourBelovedTextbox" runat="server"></asp:TextBox></asp:TableCell>
</asp:TableRow>
</asp:Table>
   
Comments
JTRizos 21-Apr-11 14:27pm
   
Thank you for your solution. It was great! As usual with this forum, I learned multiple things with your solution. Very helpful!!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900