我無法隱藏單選按鈕上的文本。這裏是收音機的asp ...asp hide單選按鈕標籤
<asp:RadioButton ID="rdViewPrint" Text="View/Print" runat="server" OnClick="javascript:disableFields();" GroupName="viewSend" Checked="True" style="margin-left:10px;" />
<asp:RadioButton ID="rdEmail" Text="Email" runat="server" OnClick="javascript:emailFields();" GroupName="viewSend" style="margin-left:10px;" />
<asp:RadioButton ID="rdFax" Text="Fax" runat="server" OnClick="javascript:faxFields();" GroupName="viewSend" style="margin-left:10px;" />
在頁面加載時,javascript函數運行下面的函數。單選按鈕的圓圈是隱藏的,但文本仍然存在。
function noVisit() {
document.getElementById('<%=lblViewSend.ClientID%>').style.display = "none";
document.getElementById('<%=rdViewPrint.ClientID%>').style.display = "none";
document.getElementById('<%=rdEmail.ClientID%>').style.display = "none";
document.getElementById('<%=rdFax.ClientID%>').style.display = "none";
document.getElementById('<%=btnFull.ClientID%>').style.display = "none";
document.getElementById('<%=btnSummary.ClientID%>').style.display = "none";
document.getElementById('<%=btnPrivate.ClientID%>').style.display = "none";
}
爲什麼文本不被隱藏,以及如何使其不可見?
謝謝,戴夫K.
謝謝你的想法。在asp中仍然很新,甚至沒有想到這一點。 –
通常隱藏或顯示面板是一個好主意。除非你正在爲單個元素做,否則隱藏/顯示該元素是更好的選擇。 – Cruril