具有“其他"选项的单选按钮列表 [英] Radiobuttonlist with an Other option

查看:72
本文介绍了具有“其他"选项的单选按钮列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试到处寻找有效的答案,并决定在这里提出我的问题.

我正在使用具有三个按钮的Radiobuttonlist,如下所示:

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:

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




选择其他"时,我被要求添加注释字段,以便用户可以输入两个选项以外的分辨率.输入的注释将替换表中存储的值"Other".

我可以在.cs中添加注释文本框并进行处理,但是将注释文本框放置在Radiobuttonlist旁边存在问题,无法完全解决.它被移动到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.

推荐答案

这里是一个非常快捷,非常肮脏的想法

here''s a quite quick and quite dirty idea

<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

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


这篇关于具有“其他"选项的单选按钮列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆