I have the following checkbox on my site but it dosen't work, tried to solve it before but still having trouble. this is the code from my first pageDo you want to take pets with you? Yes
This is the code from my second page IF strPETS = "Y" THEN strSQLLOC = strSQLLOC & " AND fldPETS = 'Y' " ELSE strSQLLOC = strSQLLOC Please help!!!
You're not capturing the value from the HTML form's checkbox. If you have a form with a checkbox name "PETS" then in your ASP script, you have to use Response.Form("PETS") to capture the value "Y" - this is only if the method of the form is "POST" - anyways, try this:
<%
IF request.form("PETS") = "Y" THEN
strSQLLOC = strSQLLOC & " AND fldPETS = 'Y' "
response.write("YOU CHECKED THE BOX")
ELSE
strSQLLOC = strSQLLOC
response.write("BOX NOT CHECKED")
end if
%> samaru
a.k.a inscissor
Team Colleague
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18