簡體   English   中英

單選按鈕無法單擊/選中

[英]Radio button cant be clicked/checked

我正在嘗試使用位於容器中的asp.net使用單選按鈕,但是如果我選擇了右單選按鈕,即使單擊了右單選按鈕,左單選按鈕也會被選中。

這是我的代碼:

<asp:RadioButton ID="rdoSmallJars" Text="Small" runat="server" GroupName="measurementSystem" style="z-index: 1; left: 350px; top: -440px; position: absolute; height: 21px;" AutoPostBack="True"/>

<asp:RadioButton ID="rdo1" Text="Test" runat="server" GroupName="measurementSystem" style="z-index: 1; left: 450px; top: -440px; position: absolute; height: 21px;" AutoPostBack="True" />

有任何想法嗎? 謝謝

您需要為每個單選按鈕賦予一個值。 如果您不這樣做,則它們將具有相同的默認值,單擊它們中的任何一個都將等效於單擊具有該值的第一個。

例如:

<asp:RadioButton Value="1" ID="rdoSmallJars" Text="Small" runat="server" GroupName="measurementSystem" style="z-index: 1; left: 350px; top: -440px; position: absolute; height: 21px;" AutoPostBack="True"/>

<asp:RadioButton Value="2" ID="rdo1" Text="Test" runat="server" GroupName="measurementSystem" style="z-index: 1; left: 450px; top: -440px; position: absolute; height: 21px;" AutoPostBack="True" />

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM