I have a form used for searching with multiple checkboxes. If the check box is checked I need to include it in the where clause for the search results. If it's not checked I want to ignore it in the where clause.
I've included the segment of the code. Essentially I want to include the checkbox form.religiontheology variable in the where clause if the user checked it. I'm trying to set it to null in the cfif statement if the user didn't check it and essentially ignore it in the where clause.
<cfif not isdefined("form.religiontheology")>
<cfparam name="form.religiontheology" default="">
<cfif not isdefined("form.math")>
<cfparam name="form.math" default="0">
<cfif not isdefined("form.cert1")>
<cfparam name="form.cert1" default="No">
<cfif not isdefined("form.catholic")>
<cfparam name="form.catholic" default="0">
<cfquery datasource="teacher-recruitment" name="teacher1">
Select PositionFullTime, FirstName, LastName, PDFFile1Name, PracticingCAT, GradDegree, CollegeDegree, CertTitle1
where #SESSION.ThisApp.CN#='-1' and #Session.ThisApp.JT#='-1' and #SESSION.ThisApp.GD#='-1' and Status='#Session.ThisApp.Sta#' and Math='#form.math#' and CatCert1YN='#form.cert1#' and PracticingCAT='#form.catholic#' and Highestdegree='#form.dg#' and ReligionTheology=isNull('#form.religiontheology#',ReligionTheology)