开发者

RadioButtonList without the Radio Button Circle?

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, th开发者_Go百科e 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!


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>


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:

RadioButtonList without the Radio Button Circle?


(source: filamentgroup.com)


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜