value="_BML7(B)"
。
我最后一次将以下代码插入到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
我真的可以使用这方面的帮助,并提前感谢大家的帮助!我对Classic 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>
答案 0 :(得分:2)
您可以将列表编译成字符串,就像这样......
Const ignoreCodes = " _04GIDBM _05GIDFM _03MIS(Q _06GIDMS _08EXHRM _10EXMKT _12EXTTH _15AFT _16HSC _18LTD _19EBM _17EXHSC "
将其添加到文件的最顶层(在任何Option Explicit
命令之后)。如果您要添加新代码,只需确保其旁边有空格。
然后只是对它进行测试......
If Instr(ignoreCodes, UCase(currentCodeValue)) = 0 Then
Response.Write("<option value='" & currentCodeValue & "' ")
If StrComp(strCurrentSelection, " " & currentCodeValue & " ", 1) = 0 then
Response.Write " selected "
End If
Response.Write(">" & objListData(strDescriptionName) & "</option>")
End If
如果您进一步考虑这一点,那么只需将列表包含在数据库的冗余代码表中即可。
答案 1 :(得分:1)
为了简单起见,只需使用基本的If..Then语句包装发送HTML的代码:
<div id="contact">
<h3>CONTACT</h3>
<p>My form</p>
<a href="javascript:void(0)" onclick="exchangeBoxes('contact', 'reset')">Reset Password</a>
<a href="javascript:void(0)" onclick="exchangeBoxes('contact', 'about')">About</a>
</div>
<div id="reset" style="display:none">
<h3>RESET</h3>
<p>Reset password form</p>
<a href="javascript:void(0)" onclick="exchangeBoxes('reset', 'contact')">Back to contact</a>
</div>
<div id="about" style="display:none">
<h3>ABOUT</h3>
<p>Some info.</p>
<a href="javascript:void(0)" onclick="exchangeBoxes('about', 'contact')">Back to contact</a></li>
</div>