我正在構建一個插件,用於根據用戶的選擇更改網站的背景顏色,供練習使用。我正在用單選按鈕來做。 我希望用戶只有一個選擇,就像普通的單選按鈕行爲一樣,但在管理頁面中,他可以選擇多種顏色,如複選框行爲,甚至無法撤消選擇的選擇。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