Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If Check box select (multi variable search)

Status
Not open for further replies.

dwarvenmilitia

Programmer
Apr 18, 2006
45
NZ
Hey everyone...

I am trying to create a multi checkbox (yes/no) search function but when the page runs with a checkbox selected, my sql query (as far as I can tell) won't be ammened to my main sql string.

Multi checkboxes as in varA, varB, varC

Basic idea is:
Code:
varA = Request.Form("Checkbox")

If varA = "true" Then
strSQL = strSQL & " AND table.field = 'Yes' "
End If
This addition to strSQL is for the WHERE section of the query string.

This issue is the POST data to this page (the checkboxes) is "checkbox=true" yet it isn't affecting the values that are returned from the query. I have a similar addition with a text box (which works for text only) but the total POST data then is "checkbox=true&textinput=john"

Cheers in advance.

--------------------------------------
I'm unique... Just like everyone else!
 
Never mind all...

Burning at both ends makes you do stupid things like put an extra character in the field name where it shouldn't be so it doesn't pick up the field property.

I have learnt my lesson! :p

Cheers all

--------------------------------------
I'm unique... Just like everyone else!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top