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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ignore variables if blank

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

On my website I have a search form with 8 checkboxes, corresponding with 8 y/n fields in my database. How should my sql statement look if I only want to use the checkboxes that are checked by the visitor? In other words, how can I tell my asp page to ignore the checkboxes that weren't checked?

Thank you;
koenraad.
koenraad_deroo@email.com
 
Well, this is not SQL, but an asp question. But to do it, for cbox1, the logic would be:

if(cbox1.yes){
//Code...
}else if(cbox1.no){
//Code...
}
else{}//Nothing

Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top