基本上,我只想要RadioButtonList沒有單選按鈕就可以了,我會對rbl進行編碼,以便選定的項目具有不同的背景色,並使它看起來更專業,單選按鈕本身我希望能夠擺脫在外觀方面......如果你知道有任何方法可以做到這一點,請讓我知道!RadioButtonList沒有單選按鈕圈?
回答
這對我幫助很大: HTTP_://www.ryanfait.com/resources/custom-checkboxes-and-radio-buttons/
此鏈接斷開,原來的主人是永遠..離線,所以內容
也許任何你讀這篇文章,可以嘗試將背景設置爲無輸入在CSS
<style>
input {
background:none !important;
}
</style>
謝謝,擺脫單選按鈕左側的空心圓,但它仍然是一個很好的資源,我已將它加入書籤,將upvote你。 – 2010-01-08 19:25:41
我想不出任何簡單的方法,不用JavaScript混合一些技巧。
這可能是你想要的東西:
Accessible, Custom Designed Checkbox and Radio Button Inputs Styled with CSS (and a dash of jQuery)
用來模擬天生的單選按鈕的圖像:
謝謝,但這並沒有擺脫單選按鈕左側的空心圓圈 – 2010-01-08 19:25:02
但這些都是圖像。看到我更新的答案。您可以創建自己的無空心圓圈。 – 2010-01-08 19:32:00
我明白你在說什麼,謝謝,將使用此作爲最後的手段,仍然在尋找一個可愛的風格=「button:dissapear.and.dont.come.back」type css style :) – 2010-01-08 19:55:49
找到一個合理的解決方案...
<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 應該已經從開始!
像往常一樣,stackoverflow只是刪除所有的HTML,沒有錯誤的代碼發佈網站的默認邏輯! – 2010-01-10 12:13:39
選擇'101010'按鈕將您的代碼縮進4格並保留格式。 – ChrisF 2010-01-12 16:33:58
謝謝克里斯,固定! – 2010-01-12 16:37:34
- 1. 如何驗證radiobuttonlist的單選按鈕?
- 2. 單選按鈕圓圈內沒有標籤
- 3. 沒有正確獲取單選按鈕中的單選按鈕
- 4. Formtastic單選按鈕沒有每個單選按鈕的標籤
- 5. Javascript:單選按鈕沒有選中值
- 6. GUI:單選按鈕組沒有選擇?
- 7. 檢查單選按鈕沒有選擇
- 8. 單選按鈕沒有正確選擇
- 9. React JS單選按鈕沒有選擇
- 10. 從RadioButtonList中選擇單選按鈕,URL爲
- 11. RadioButtonList在按鈕上丟失值單擊
- 12. 單選按鈕使得表單提交按鈕沒有反應
- 13. 單選按鈕提交沒有值
- 14. MVC單選按鈕沒有調用ActionResult
- 15. 沒有列表的組單選按鈕
- 16. 的Watir單選按鈕沒有找到
- 17. Chrome 21沒有檢查單選按鈕
- 18. 單選按鈕沒有得到遏制
- 19. jquery單選按鈕沒有切換?
- 20. jQuery:單選按鈕沒有被檢查
- 21. 測試是否沒有單選按鈕
- 22. 單選按鈕沒有被驗證
- 23. Firefox單選按鈕沒有檢查?
- 24. 如果沒有單選按鈕經過
- 25. 單選按鈕沒有在PHP工作
- 26. 沒有任何單選按鈕的ListPreferences?
- 27. 沒有得到單選按鈕值php
- 28. 使用CSS將listitem.text放置在radiobuttonlist中的單選按鈕上
- 29. 如何禁用JavaScript中的RadioButtonList中的某個單選按鈕
- 30. 如何獲取RadioButtonList中特定單選按鈕的HTML ID
任何人都有一些代碼? – 2010-01-08 21:00:25