我正在构建一个插件,用于根据用户的选择更改网站的背景颜色,供练习使用。我正在用单选按钮来做。 我希望用户只有一个选择,就像普通的单选按钮行为一样,但在管理页面中,他可以选择多种颜色,如复选框行为,甚至无法撤消选择的选择。WP管理页面上的单选按钮
代码:
<div class = "wrap">
<h3>Please choose a color</h3>
<form style = "line-height:400%" method = "POST" action = "">
Black <input type="radio" name = "black" value = "Black" />
White <input type = "radio" name = "white" value = "White" />
Red <input type = "radio" name = "eed" value = "Red" />
Green <input type = "radio" name = "green" value = "Green" />
Yellow <input type = "radio" name = "yellow" value = "Yellow" /> <br/>
Orange <input type = "radio" name = "orange " value = "Orange " />
Blue <input type = "radio" name = "blue" value = "Blue" />
Pink <input type = "radio" name = "pink" value = "Pink" />
Purple <input type = "radio" name = "purple" value = "Purple" />
Brown <input type = "radio" name = "brown" value = "Brown" /><br/>
<p>Hax color<input type = "text" name = "hax" size = "5" /></p>
</form>
</div>
我怎样才能解决这个问题?
用于所有单选按钮同名 – Yatendra 2015-04-06 09:16:09
请开始搜索您所选择的HTML参考。您可以先阅读书籍或了解高质量的在线资源。在*之后询问你的方式*开始时没有先考虑哪些标签用于什么以及如何工作并不是一个好主意。特别是因为这些问题会让你提出的问题在很大程度上不在Stackoverflow上。所以先制定一个计划,然后编写代码。 – hakre 2015-04-06 09:26:49