Asp classic 经典ASP多复选框单击重定向到具有值的同一页面

Asp classic 经典ASP多复选框单击重定向到具有值的同一页面,asp-classic,Asp Classic,我正在根据复选框值进行一些搜索。如果我选择一个复选框,我需要一个值,如果我选择第二个复选框,我还需要两个复选框值 目前我有单选按钮的代码。需要将它们转换为具有多个选择的复选框。根据请求值,它将传递给存储过程 <% if request("view")="Key CIA Initiative" then %> <input type="radio" checked="checked" onclick="javascript:document.location='Index

我正在根据复选框值进行一些搜索。如果我选择一个复选框,我需要一个值,如果我选择第二个复选框,我还需要两个复选框值

目前我有单选按钮的代码。需要将它们转换为具有多个选择的复选框。根据请求值,它将传递给存储过程

<% if request("view")="Key CIA Initiative" then %>
<input type="radio" checked="checked" 
   onclick="javascript:document.location='Index.asp?view=Key CIA Initiative'" />
<input type="radio" onclick="javascript:document.location='Index.asp?view=High'" />
<input type="radio"  onclick="javascript:document.location='Index.asp'" />

<% else %>

<% if request("view")="High" then %>
<input type="radio"  onclick="javascript:document.location='Index.asp?view=Key            
 Initiative'" />
<input type="radio" checked="checked" onclick="javascript:document.location='Index.asp?
view=High'" /> 
<input type="radio"  onclick="javascript:document.location='Index.asp'" />
<% else %>
<input type="radio"  onclick="javascript:document.location='Index.asp?view=Key CIA 
Initiative'" />
<input type="radio"  onclick="javascript:document.location='Index.asp?view=High'" />
<input type="radio"  onclick="javascript:document.location='Index.asp'" /> 
<%end if%>
<%end if%>       

您必须执行以下操作:

<%
Response.write "Request(view)="& request("view") & "<br />"
'Now, if request("view") has nultiple values, How are you going to call the sp? 
'pass both values to it?
If Trim(Request("view"))<>"" Then

    If InStr(Request("view"),"All")<>0 Then
        strSQL="Exec sp_get_Project_list"
    Else
    strSQL = "Exec sp_get_Project_list '"& Request("view") &"'"
    End if
Response.write "strSQL ="& strSQL & "<br />"
End If
%>
<form>
<input type="checkbox" name="view" value="Key CIA Initiative" <% if InStr(request("view"),"Key CIA Initiative")>0 then %> checked="checked"<%End If%> />Key CIA Initiative <br/>
<input type="checkbox" name="view" value="High" <%if InStr(request("view"),"High")>0 then %> checked="checked"<%End If%>  />High<br/>
<input type="checkbox" name="view" value="All" <%if InStr(request("view"),"All")>0 then %> checked="checked"<%End If%> />All <br/>
<input type="submit">
</form>

checked=“checked”/>关键CIA计划
checked=“checked”/>高
checked=“checked”/>全部

请粘贴复选框代码片段,以便有人可以引用实际的html或脚本。特别重要的是复选框名称和ID。显示关键计划项目显示高优先级项目显示所有项目我无法格式化代码,因此没有发布代码。如果我对单选按钮的请求是“1”,那么我将显示选中值为“checked”的单选按钮,然后单击单选按钮重定向到同一页面,此时传递查询字符串值。代码读取的方式是,选中单选按钮触发javascript事件,该事件依次出现以刷新页面。如果要检查多个项目,则必须在某些事件中触发对SP的调用,而不是单击复选框/按钮。我假设单选按钮是在“表单”中分组的。选中所有所需框后,您单击的按钮或链接是什么?现在我有3个单选按钮(值为High、Key Initiative和all)。我可以发送每个值,然后通过将值发送到数据库并显示搜索结果进行重试,但现在我想添加复选框而不是单选框。因此,用户应该能够同时选择这两个值(高值和关键值),并需要在同一搜索页面中显示结果。我无法同时选中这两个复选框。无法同时捕获这两个值感谢您的帮助。如果没有“提交”按钮,这是否可能?这将很困难。因为如果使用onclick,每次单击页面都会刷新(或提交)。。
<%
Response.write "Request(view)="& request("view") & "<br />"
'Now, if request("view") has nultiple values, How are you going to call the sp? 
'pass both values to it?
If Trim(Request("view"))<>"" Then

    If InStr(Request("view"),"All")<>0 Then
        strSQL="Exec sp_get_Project_list"
    Else
    strSQL = "Exec sp_get_Project_list '"& Request("view") &"'"
    End if
Response.write "strSQL ="& strSQL & "<br />"
End If
%>
<form>
<input type="checkbox" name="view" value="Key CIA Initiative" <% if InStr(request("view"),"Key CIA Initiative")>0 then %> checked="checked"<%End If%> />Key CIA Initiative <br/>
<input type="checkbox" name="view" value="High" <%if InStr(request("view"),"High")>0 then %> checked="checked"<%End If%>  />High<br/>
<input type="checkbox" name="view" value="All" <%if InStr(request("view"),"All")>0 then %> checked="checked"<%End If%> />All <br/>
<input type="submit">
</form>