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 page
<P>Do you want to take pets with you?
<INPUT type=CHECKBOX name = "PETS" value = "Y">Yes<br>
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
%>
Reputation Points: 262
Solved Threads: 18
a.k.a inscissor
Offline 1,227 posts
since Feb 2002