1

我对 ASP 很陌生,并且有以下代码:

<tr>
    <td style="padding-bottom:5px;">Would you return to this practice again?&nbsp;&nbsp;<asp:RequiredFieldValidator SetFocusOnError="true" ID="rfvReturn" runat="server" ControlToValidate="rblReturn" ErrorMessage="*" ForeColor="Red" Font-Bold="true" Display="Dynamic" /></td>
    <td style="padding-bottom:5px;">
    <asp:RadioButtonList runat="server" ID="rblReturn"  RepeatDirection="Horizontal">
        <asp:ListItem Value="true" Text="Yes" />
        <asp:ListItem Value="false" Text="No" />
    </asp:RadioButtonList>
    </td>
</tr>
<tr class="spaceUnder">
    <td style="padding-bottom:5px;">Would you refer a friend to this practice?&nbsp;&nbsp;<asp:RequiredFieldValidator SetFocusOnError="true" ID="rfvRefer" runat="server" ControlToValidate="rblRefer" ErrorMessage="*" ForeColor="Red" Font-Bold="true" Display="Dynamic" /></td>
    <td style="padding-bottom:5px;">
    <asp:RadioButtonList runat="server" ID="rblRefer"  RepeatDirection="Horizontal">
        <asp:ListItem Value="true" Text="Yes" />
        <asp:ListItem Value="false" Text="No" />
    </asp:RadioButtonList>
    </td>
</tr>

此代码创建以下内容:

当前的

我想做的是用可以切换的图像替换单选按钮,看起来像这样:

首选

我到处搜索,但似乎找不到办法。

4

1 回答 1

0

这可能不是正确的方法,但是将图片作为指向 javascript 函数的链接怎么样。该函数可以用 0 或 1 填充文本框,具体取决于单击了哪个。

    function radiobutton() {
      document.getElementById("radiotext").value="1"; 
}

然后只是隐藏文本框:

<div style="width: 0; height: 0; overflow: hidden;">
<input type="text">
</div>

这应该工作...

于 2013-09-10T18:09:45.993 回答