我问了几个月后如何隐藏从数据库中拉出的经典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
此代码发送下拉列表选项。这与你所要求的无关。请分享您产生您提及的单选按钮的实际代码,我们可以尝试帮助您改变它。 –