record sorting through checkbox values - need help
jaywalk101 | Posted 3:06pm 22. May 2008 Server Time |
Hey guys its been a while since I last posted. I'm glad this sites still around. I need some help with an asp project i'm working on. I'm trying to let a user be able to sort records
by different fields using checkboxes. I'm kind of on the right track, but I'm missing something. I need help choosing one or more options. I Possibly may need an array, not sure.. here's my code though.. thanks for any help in advance!!! I will continue to research.. .
**********************************************************
HTML
<form action="results1.asp" method="post" name="form" align="center">
<p><i><font face="Times New Roman" size="7">Provider
Database</font></i></p>
<p align="center"><b>County:</b></p>
<div align="center">
<center>
<p>Pasquotank<input type="checkbox" name="pasquotank" value="pasquotank"></p>
<p>Camden<input type="checkbox" name="camden" value="camden"></p>
<p><b>Services:</b></p>
<p> CSA <input type="checkbox" name="csa" value="csa"></p>
<p>CSC <input type="checkbox" name="csc" value="csc"></p>
<p><input type="submit" value="Submit" name="B1"></p>
<p> </p>
</center>
</div>
</form>
******************************************************
ASP and VBscript
<%
Dim SqlForm
Set DbSearch = Server.CreateObject("ADODB.Connection")
DbSearch.Open = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("providers.mdb")
SqlForm = "SELECT * FROM providers WHERE"
If Request.Form("pasquotank") = "pasquotank" Then
SqlForm = SqlForm & " county='pasquotank' or "
Else If Request.Form("pasquotank") = "" Then
End If
End IF
If Request.Form("camden") = "camden" Then
SqlForm = SqlForm & " county='camden' "
Else If Request.Form("camden") = "" Then
End If
End IF
<%
|