RadioButtonList 没有单选按钮圆圈?

发布于 2024-08-16 22:36:01 字数 112 浏览 8 评论 0原文

基本上,我只想要没有单选按钮的 RadioButtonList,我将对 rbl 进行编码,以便所选项目具有不同的背景颜色并使其看起来更专业,单选按钮本身我希望能够摆脱术语外观...如果您知道任何方法,请告诉我!

basically, i just want the RadioButtonList without the radio button on it, i will code the rbl so that selected items have a different background color and make it look more professional, the radio buttons themselves i want to be able to get rid of in terms of apperance... if you know of any way to do it, please do let me know!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

半透明的墙 2024-08-23 22:36:01

这对我帮助很大:
http_://www.ryanfait.com/resources/custom-checkboxes-and-radio-buttons/

此链接已损坏,原所有者..永远离线,因此内容

也许 对于阅读本文的任何人,可以尝试在 css 的输入中将背景设置为无

<style>
   input {
      background:none !important;
   }
</style>

this helped me a lot:
http_://www.ryanfait.com/resources/custom-checkboxes-and-radio-buttons/

This link is broken, the original owner is.. forever offline, so the content

Perhaps for any of you reading this, can try to set the background to none in the input in the css

<style>
   input {
      background:none !important;
   }
</style>
自找没趣 2024-08-23 22:36:01

如果不将一些技巧与 javascript 混合在一起,我想不出任何简单的方法。

这可能是您想要的:
可访问的、自定义设计的复选框和单选按钮输入CSS(和少量 jQuery)

独立演示位于此处

用于模仿单选按钮的图像: 单选按钮图像
(来源:filamentgroup.com

I can't think of any straightforward method without mixing some tricks with javascript.

This could be something you want:
Accessible, Custom Designed Checkbox and Radio Button Inputs Styled with CSS (and a dash of jQuery)

The stand-a-lone demo here.

The image used to mimick the radio buttons: Radio Button Image
(source: filamentgroup.com)

清风夜微凉 2024-08-23 22:36:01

找到了一个看似合理的解决方案...

    <head runat="server">
    <title>Test - Hide radio circles from radiobuttonlist</title>
    <script type="text/javascript">
    function hideRadioSymbol()
    {
        var rads = new Array();
        rads = document.getElementsByName('list1'); //Whatever ID u have given to ur radiolist.
        for(var i = 0; i < rads.length; i++)
            document.getElementById(rads.item(i).id).style.display = 'none'; //hide
    }
    </script>
    </head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:RadioButtonList ID="list1" runat="server">
            <asp:ListItem Value="item1" Text="item1"></asp:ListItem>
            <asp:ListItem Value="item2" Text="item2"></asp:ListItem>
        </asp:RadioButtonList>
    </div>
    <script type="text/javascript">hideRadioSymbol()</script> //After list is completely rendered/loaded.
    </form>
</body>
</html>

哦,顺便说一句,mvc 很棒,这就是 asp.net 应该 从一开始就是这样的!

found a plausible solution...

    <head runat="server">
    <title>Test - Hide radio circles from radiobuttonlist</title>
    <script type="text/javascript">
    function hideRadioSymbol()
    {
        var rads = new Array();
        rads = document.getElementsByName('list1'); //Whatever ID u have given to ur radiolist.
        for(var i = 0; i < rads.length; i++)
            document.getElementById(rads.item(i).id).style.display = 'none'; //hide
    }
    </script>
    </head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:RadioButtonList ID="list1" runat="server">
            <asp:ListItem Value="item1" Text="item1"></asp:ListItem>
            <asp:ListItem Value="item2" Text="item2"></asp:ListItem>
        </asp:RadioButtonList>
    </div>
    <script type="text/javascript">hideRadioSymbol()</script> //After list is completely rendered/loaded.
    </form>
</body>
</html>

oh and btw, mvc is awesome, it's how asp.net should have been from the begining!!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文