You're using session variables in the query, but you're not setting them anywhere on this page. ----- Original Message ----- From: <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Wednesday, June 11, 2003 11:25 PM Subject: Checkbox woes
> I am have a bit of a time with this whole checkbox thing. The check boxes are for users to select an item if they want to include it in the search. They always return a 0 instead of a 1 if I have a box checked thus it is not being used by my query on the action page as a search criteria. > > Maybe I am tired but I need to get this done. The follwoing is my form code followed by the action code. Any help is appreciated in advance. > > FORM PAGE: > <form action="SearchSaleList.cfm" method="get" > > <table width="100%" border="0" cellspacing="0" cellpadding="0"> > <tr> > <td width="20"><input name="SALEITEM1" type="checkbox" value="on"></td> > <td><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Books</font></strong></td> > <td width="20"><input name="SALEITEM2" type="checkbox" value="on"></td> > <td><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Music > Items</font></strong></td> > </tr> > </table> > <input type ="submit" value="submit"> > </form> > > ACTION PAGE: > > <CFPARAM NAME="form.SALEITEM1" DEFAULT="0"> > <CFPARAM NAME="form.SALEITEM2" DEFAULT="0"> > > <cfif form.SALEITEM1 is "on"><CFSET vSI1 = 1><CFELSE><CFSET vSI1 = 0></CFIF> > <cfif form.SALEITEM2 is "on"><CFSET vSI2 = 1><CFELSE><CFSET vSI2 = 0></CFIF> > > <cfquery name="getsales" datasource="#dsnname#"> > SELECT sm.sid as rf1,sm.SALEADDR as rf2, sm.SALEcity as rf4,sM.saletype as rf3, s.saledate as rf5, s.saletimefrom+' - '+saletimeto as rf6 > FROM sale_master sm, sale s > WHERE sm.sid = s.sid > AND s.saleDisplay = 'Yes' > AND sm.SALEreleased = 1 > <cfif #session.vSI1# EQ 1>AND sm.SALEITEM1 = #session.vSI1#)</cfif> > <cfif #session.vSI2# EQ 1>AND sm.SALEITEM2 = #session.vSI2#)</cfif> > </cfquery> > > .................................... > Get your own free email account from > http://www.popmail.com > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

