我問了幾個月後如何隱藏從數據庫中拉出的經典ASP頁面上的一些下拉選項,以便用戶無法選擇這些選項。但現在剩餘的選項之一出現了3個收音機選項。我必須刪除其中的一個選項。根據Chrome,我需要刪除的選項叫做value="_BML7(B)"
。隱藏ASP經典頁面上的單選按鈕選項
上次我將以下代碼插入到include.asp
文件中,該文件運行良好,但隱藏了下拉選項。我需要從當前的下拉選項中隱藏一個單選按鈕選項。
Sub buildDropDownList(strCurrentSelection, objListData, strCodeName, strDescriptionName, blnIncludeOther)
If Not objListData.BOF Then
objListData.MoveFirst
End If
Dim currentCodeValue
While Not objListData.EOF
currentCodeValue = objListData(strCodeName)
If (UCase(currentCodeValue)<>"_04GIDBM") And _
(UCase(currentCodeValue)<>"_05GIDFM") And _
(UCase(currentCodeValue)<>"_03MIS(Q") And _
(UCase(currentCodeValue)<>"_06GIDMS") And _
(UCase(currentCodeValue)<>"_08EXHRM") And _
(UCase(currentCodeValue)<>"_10EXMKT") And _
(UCase(currentCodeValue)<>"_12EXTTH") And _
(UCase(currentCodeValue)<>"_15AFT") And _
(UCase(currentCodeValue)<>"_16HSC") And _
(UCase(currentCodeValue)<>"_18LTD") And _
(UCase(currentCodeValue)<>"_19EBM") And _
(UCase(currentCodeValue)<>"_17EXHSC") Then
Response.Write "<option value='" & currentCodeValue & "' "
If StrComp(strCurrentSelection, currentCodeValue, 1) = 0 then
Response.Write "selected"
End If
Response.Write ">" & objListData(strDescriptionName) & "</option>" & VbCrLf
End If
我真的可以使用這個幫助,並提前感謝大家的幫助!我不是很擅長經典ASP,但我正在嘗試。
下面是我上次插入的include.asp
文件中的代碼。
<p align="center">
<%
do until rsProgramLevel.EOF
Response.Write "<input type=""radio"" name=""programcode"" onclick=""onProgramCode()"" "
Response.Write "value=""" & rsProgramLevel("ProgramCode") & """ "
if rsProgramLevel("ProgramCode") = strProgramCode then
Response.Write "checked"
end if
Response.Write ">"
Response.Write " "
Response.Write rsProgramLevel("LevelDescription") & " (£" & FormatNumber(rsProgramLevel("ChargeValue"), 2) & ") "
Response.Write " "
rsProgramLevel.MoveNext
loop
%>
</p>
是否有特定的原因,你不能排除在數據庫級不需要的代碼?即在它們進入你的ASP頁面之前? – Martha
相信與否我無法訪問數據庫,因此我不得不這樣做。 – user2219472
此代碼發送下拉列表選項。這與你所要求的無關。請分享您產生您提及的單選按鈕的實際代碼,我們可以嘗試幫助您改變它。 –