Re: Check boxes
update tablename set formfield1 = cfqueryparam value=#form.formfield1# cfsqltype=cf_sql_varchar where formfield2 in cfqueryparam value=#form.formfield2# cfsqltype=cf_sql_integer list=true On Fri, Mar 4, 2011 at 11:01 AM, Scott Williams myscottwilli...@yahoo.comwrote: Hello all -- I have a form that contains checkboxes which sends multiple record numbers to an action form for processing. For example, it would send: formfield1=ABC formfield2=1,2,3,4,5,6,7 In the database I want to update the formfield1 column to ABC wherever the formfield2 column value is either 1 or 2 or 3 or 4 or 5 or 6 or 7. I've tried a few different ways to do this, but only one record gets updated. Any tips on how I can accomplish this? Scott ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342752 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Check boxes
Are you doing the update via a SQL statement or stored proc? On Fri, Mar 4, 2011 at 11:01 AM, Scott Williams myscottwilli...@yahoo.comwrote: Hello all -- I have a form that contains checkboxes which sends multiple record numbers to an action form for processing. For example, it would send: formfield1=ABC formfield2=1,2,3,4,5,6,7 In the database I want to update the formfield1 column to ABC wherever the formfield2 column value is either 1 or 2 or 3 or 4 or 5 or 6 or 7. I've tried a few different ways to do this, but only one record gets updated. Any tips on how I can accomplish this? Scott ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342753 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Check boxes
Never mind -- I figured it out. This works: cfquery name=query2 datasource=#dsn# UPDATE aTable SET ColumnA = '#form.var1#' WHERE ColumnB IN (#form.var2#) /cfquery I had tried using IN in my update query except that I didn't include the parentheses. Scott ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342754 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Check boxes
That is exactly what I was going to suggest. Good job. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342755 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Check boxes
Be sure to add cfqueryparam / to your query. If you want to know why, post a link to your live site, and we can show you. :-) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342756 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Check boxes
lol On 3/4/2011 12:26 PM, Matt Quackenbush wrote: Be sure to addcfqueryparam / to your query. If you want to know why, post a link to your live site, and we can show you. :-) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342757 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Check boxes
SET ColumnA = '#form.var1#' WHERE ColumnB IN (#form.var2#) How ever, make sure you check for form.var2 not being empty, because ColumnB IN () causes an error. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342761 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Check Boxes
Showing code would be a good first step... On Tue, Dec 8, 2009 at 6:27 AM, Damo Drumm damien.dr...@quinn-group.comwrote: Hi can someone help me out here, Im trying to have a check box for each invoice so when its ticked and you press submit all the ticked invoices will be sent to the revelant email address, I'm trying to have it so the check boxes will be defaulted to ticked if the customer Number for the invoice, is in the Customer Table, The next problem I have is for each Customer I add to the Customer Table its duplicating the Data and showing everything twice if theres 2 Customers. or 3 times if theres 3 Customers added and so on, I cant seem to figure out why its doing this any tips would be great ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328951 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Check Boxes
On Tue, Dec 8, 2009 at 9:27 AM, Damo Drumm damien.dr...@quinn-group.comwrote: Hi can someone help me out here, Im trying to have a check box for each invoice so when its ticked and you press submit all the ticked invoices will be sent to the revelant email address, I'm trying to have it so the check boxes will be defaulted to ticked if the customer Number for the invoice, is in the Customer Table, The next problem I have is for each Customer I add to the Customer Table its duplicating the Data and showing everything twice if theres 2 Customers. or 3 times if theres 3 Customers added and so on, I cant seem to figure out why its doing this any tips would be great 1) only send email to customers who have a checkbox next to them one way would be to input type=checkbox name=sendEmail_customerID for each record the on the action page loop around the list of IDs and send the emails. 2) have the checkbox defaulted to checked use a cfif conditionchecked /cfif 3) Looks like you have a Cartesian join. You need to edit your SQL query. Without any code these are my best guesses. W ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328952 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Check Boxes
Heres the code im using cfquery name=qgetcustomer datasource=#request.dsn# SELECT invoice.*, customer.CUSTOMER_Name FROM invoice left join customer on invoice.CUSTOMER_AccNum = customer.CUSTOMER_AccNum; /cfquery /select /td tdInvoice Number : input type=text name=INVOICE_Number size=12/td tdCustomer Number : input type=text name=CUSTOMER_AccNum size=12/td tdCustomer Name : input type=text name=CUSTOMER_Name size=12/td tdinput type=submit name=Findinvoices value=Find raquo; //td /tr /form /table cfif isdefined(form.COMPANY_Number) cfif form.COMPANY_Number eq pYour Search has returned 0 results/p cfelse cfquery name=qgetinvoices datasource=#request.dsn# select I.INVOICE_DateAdded, I.COMPANY_Number, I.INVOICE_Number, C.COMPANY_Name, I.INVOICE_Key, I.CUSTOMER_AccNum, CU.CUSTOMER_Name from INVOICE I, COMPANY C, CUSTOMER CU where I.COMPANY_Number = C.COMPANY_Number AND I.COMPANY_Number = '#form.COMPANY_Number#' AND I.INVOICE_Number LIKE '%#form.INVOICE_Number#%' AND I.CUSTOMER_AccNum LIKE '%#form.CUSTOMER_AccNum#%' AND CU.CUSTOMER_Name LIKE '%#form.CUSTOMER_Name#%' AND I.INVOICE_PDFFile '' /cfquery ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328953 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Check Boxes
cfquery name=qgetinvoices datasource=#request.dsn# select I.INVOICE_DateAdded, I.COMPANY_Number, I.INVOICE_Number, C.COMPANY_Name, I.INVOICE_Key, I.CUSTOMER_AccNum, CU.CUSTOMER_Name from INVOICE I, COMPANY C, CUSTOMER CU where I.COMPANY_Number = C.COMPANY_Number AND I.COMPANY_Number = '#form.COMPANY_Number#' AND I.INVOICE_Number LIKE '%#form.INVOICE_Number#%' AND I.CUSTOMER_AccNum LIKE '%#form.CUSTOMER_AccNum#%' AND CU.CUSTOMER_Name LIKE '%#form.CUSTOMER_Name#%' AND I.INVOICE_PDFFile '' /cfquery This query looks like it gets the results for your search. You have 3 tables: invoice, company, and customer. You join the invoice table and the company table via the SQL, I.COMPANY_Number = C.COMPANY_Number. Unfortunately you do not join customer table to the other 2 tables. This is why you are always getting more results than you want. You need to join the invoice table to the customer table. the top half of your code looks like it was not a full cut and paste. If it was then it really doesn't make any sense. What is the query, qgetcustomer, being used for? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328954 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Check Boxes
This was what i meant to put in instead of qgetcustomer query So am I still missing a join somewhere cfif isdefined(url.invoice) cfquery name=qgetcompanyno datasource=#request.dsn# select COMPANY_Number, INVOICE_Number, CUSTOMER_AccNum from INVOICE where INVOICE_Key = #url.invoice# /cfquery cfset form.INVOICE_Number = qgetcompanyno.INVOICE_Number cfset form.COMPANY_Number = qgetcompanyno.COMPANY_Number /cfif ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328955 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Check Boxes
On Tue, Dec 8, 2009 at 10:35 AM, Damo Drumm damien.dr...@quinn-group.comwrote: This was what i meant to put in instead of qgetcustomer query So am I still missing a join somewhere cfif isdefined(url.invoice) cfquery name=qgetcompanyno datasource=#request.dsn# select COMPANY_Number, INVOICE_Number, CUSTOMER_AccNum from INVOICE where INVOICE_Key = #url.invoice# /cfquery cfset form.INVOICE_Number = qgetcompanyno.INVOICE_Number cfset form.COMPANY_Number = qgetcompanyno.COMPANY_Number /cfif based on the code you sent me, yes I believe you are still missing a join in qgetinvoices cfquery name=qgetinvoices datasource=#request.dsn# select I.INVOICE_DateAdded, I.COMPANY_Number, I.INVOICE_Number, C.COMPANY_Name, I.INVOICE_Key, I.CUSTOMER_AccNum, CU.CUSTOMER_Name from INVOICE I, COMPANY C, CUSTOMER CU where I.COMPANY_Number = C.COMPANY_Number and CU.invoice_number = I.invoice_number /cfquery This all depends if invoice_number is unique in the invoice table. if it isn't then you have more work to do. If so, this is the basic query. Then you can add in more conditions to the where clause get only the results you want. In this schema, what does the company represent? the seller, the buyer, both? Is the customer an individual or a company? if it is a company why are there to separate tables? Not saying any of your schema is incorrect. Just relevant information to try help you. Even if there was something wrong with the schema not sure you could even change it right now. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328956 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Check Boxes
The company table represents the seller, and the Customer table represents the individual Buyers. Invoice_Number is unique but I also have INVOICE_Key in the INVOICE table ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328961 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Check Boxes
On Tue, Dec 8, 2009 at 11:53 AM, Damo Drumm damien.dr...@quinn-group.comwrote: The company table represents the seller, and the Customer table represents the individual Buyers. Invoice_Number is unique but I also have INVOICE_Key in the INVOICE table If that is the case then the query should work COMPANY - INVOICE - CUSTOMER This is how the information is joined. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328962 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Check Boxes not checked
Can you send a larger chunk of the code? I cant tell if this code is in a loop or not. Also the value getMemberEmailGroupsRet.GroupID I am assuming this is from a query? In any case, something above this is probably the cause of your problem. Best guess, the GroupID is not getting incremented, if it needs to. Or the x value isn't getting incremented... It's hard to tell from this small sample. On 1/31/07, Bruce Sorge [EMAIL PROTECTED] wrote: I have this line of code3: input type=checkbox name=emailgroup value=#EmailListArray[x][1]# cfif EmailListArray[x][1] IS getMemberEmailGroupsRet.GroupID Checked/cfif As you can see it is supposed to do a comparison and if there is a match, the corresponding checkbox should be checked. But what it is doing is only checking the first box and no others. Can anyone tell me why this is happening? -- Bruce Sorge I'm a mawg: half man, half dog. I'm my own best friend! ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:268263 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Check Boxes not checked
I'm not quite sure what your code is doing, but when I do what you appear to be doing, I'm always comparing the current value is found in a list...then I chek the box (as multiple checkboxes with the same name have their values passed as a list). So something like (assuming outputting checkboxes in a loop): input type=checkbox name=chkVehicleOptions value=#currentOptionID# cfif listFind(currentOptionID, FORM.chkVehicleOptions)checked/cfif Not sure if that was clear enough ;-) HTH Cheers Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:268264 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Check Boxes not checked
cfloop from=1 to=#ArrayLen(EmailListArray)# index=x cfoutput td width=20 input type=checkbox name=emailgroup value=#EmailListArray[x][1]# cfif EmailListArray[x][1] IS getMemberEmailGroupsRet.GroupID Checked/cfif /td td cfif EmailListArray[x][3] IS 1 font color=Red#EmailListArray[x][2]#/font cfelse #EmailListArray[x][2]# /cfif /td /cfoutput cfif x MOD 4 EQ 0 /tr tr /cfif /cfloop Bruce Sorge I'm a mawg: half man, half dog. I'm my own best friend! On 1/31/07, Alan Rother [EMAIL PROTECTED] wrote: Can you send a larger chunk of the code? I cant tell if this code is in a loop or not. Also the value getMemberEmailGroupsRet.GroupID I am assuming this is from a query? In any case, something above this is probably the cause of your problem. Best guess, the GroupID is not getting incremented, if it needs to. Or the x value isn't getting incremented... It's hard to tell from this small sample. ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:268266 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Check Boxes not checked
What is x? Are you incrementing it? Perhaps that needs to be currentrow? Are you looping over a query? Otherwise getMemberEmailGroupsRet.GroupID will always return the value for the first record in the result set? ~Brad -Original Message- From: Bruce Sorge [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 2:56 PM To: CF-Talk Subject: Check Boxes not checked I have this line of code3: input type=checkbox name=emailgroup value=#EmailListArray[x][1]# cfif EmailListArray[x][1] IS getMemberEmailGroupsRet.GroupID Checked/cfif As you can see it is supposed to do a comparison and if there is a match, the corresponding checkbox should be checked. But what it is doing is only checking the first box and no others. Can anyone tell me why this is happening? ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:268269 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Check Boxes not checked
In case anyone is wondering, regarding the checkbox issue, I am querying two tables. tblEmailGroups and tblEmailGroupNames tblEmailGroupNames has the names and ID of all of the email groups that a user can check to subscribe to. tblEmailGroups contains the GroupID of the email group and the UserID of the user. So what I am doing is, as I loop through the query I want to see if the ID number from tblEmalGroups matches any in tblEmailGroupNames, and if there is a match, check the checkbox. Bruce ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:268270 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Check Boxes not checked
getMemberEmailGroupsRet.GroupID will only return the first record. Is that your intention? If not try listFind() On 1/31/07, Bruce Sorge [EMAIL PROTECTED] wrote: In case anyone is wondering, regarding the checkbox issue, I am querying two tables. tblEmailGroups and tblEmailGroupNames tblEmailGroupNames has the names and ID of all of the email groups that a user can check to subscribe to. tblEmailGroups contains the GroupID of the email group and the UserID of the user. So what I am doing is, as I loop through the query I want to see if the ID number from tblEmalGroups matches any in tblEmailGroupNames, and if there is a match, check the checkbox. Bruce ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:268272 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Check Boxes not checked
Output getMemberEmailGroupsRet.GroupID and you should see that it is the same value every time. What I would do is build a list of all the subscribed groups using ValueList(), and then you need to do cfif listfindnocase(list_of_subscribed_groups, EmailListArray[x][1] So basically you are checking each subscribed group against each available group. ~Brad -Original Message- From: Bruce Sorge [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 3:06 PM To: CF-Talk Subject: Re: Check Boxes not checked cfloop from=1 to=#ArrayLen(EmailListArray)# index=x cfoutput td width=20 input type=checkbox name=emailgroup value=#EmailListArray[x][1]# cfif EmailListArray[x][1] IS getMemberEmailGroupsRet.GroupID Checked/cfif /td td cfif EmailListArray[x][3] IS 1 font color=Red#EmailListArray[x][2]#/font cfelse #EmailListArray[x][2]# /cfif /td /cfoutput cfif x MOD 4 EQ 0 /tr tr /cfif /cfloop ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:268273 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Check Boxes not checked
Thanks to everyone who helped out on this one. I got it to work like this: I used Bryan's example and it worked fine. input type=checkbox name=emailgroup value=#EmailListArray[x][1]# cfif ListFind(EmailListArray[x][1], getMemberEmailGroupsRet.GroupID) Checked/cfif ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:268277 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Check Boxes not checked
Sweet.glad it helped ;-) Cheers Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com Notice: This message, including any attachments, is confidential and may contain information that is privileged or exempt from disclosure. It is intended only for the person to whom it is addressed unless expressly authorized otherwise by the sender. If you are not an authorized recipient, please notify the sender immediately and permanently destroy all copies of this message and attachments. ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:268279 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Check Boxes - another NUG question
Worked! Thanks for the advice. What is a bit daunting about CF for newbies is the various valid approaches to accomplish the same task. Rick -Original Message- From: Kreig Zimmerman [mailto:kkz;foureyes.com] Sent: Friday, 01 November, 2002 10:54 To: CF-Talk Subject: Re: Check Boxes - another NUG question Oh yeah, I may have slightly misunderstood the last question, so to add: The way to do this on the form page is this: input type=checkbox name=thisBox value=1#iif(Query.thisBox, DE(' checked'),DE(''))# .since it is a boolean we are using as a value, in the IIF, 1 evaluates to true, and 0 to false. Thus only 1s make the checkbox be checked. Randell B Adkins wrote: In the database field you can set the value to anything you want, however you will need to test for the value to properly set the checkboxes on the form to be checked or unchecked. Example: CheckBoxField: Value could be AGREE or DISAGREE on the Form: input type=checkbox name=abc value=Agree CFIF qMyQuery.CheckBoxField EQ 'AGREE'checked/cfif [EMAIL PROTECTED] 11/01/02 10:29AM When querying a db where some original input fields were check boxes and were inserted into the db as a binary (yes/no, 1/0, on/off), is the only way to display a check box on the query page, either checked or unchecked, to create a form and add an insert field? If so, I'm having trouble with the conditional logic. Is there an approach I'm overlooking. Rick ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com
Re: Check Boxes - another NUG question
In the database field you can set the value to anything you want, however you will need to test for the value to properly set the checkboxes on the form to be checked or unchecked. Example: CheckBoxField: Value could be AGREE or DISAGREE on the Form: input type=checkbox name=abc value=Agree CFIF qMyQuery.CheckBoxField EQ 'AGREE'checked/cfif [EMAIL PROTECTED] 11/01/02 10:29AM When querying a db where some original input fields were check boxes and were inserted into the db as a binary (yes/no, 1/0, on/off), is the only way to display a check box on the query page, either checked or unchecked, to create a form and add an insert field? If so, I'm having trouble with the conditional logic. Is there an approach I'm overlooking. Rick ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com
Re: Check Boxes - another NUG question
The way I've always done this is this: On the form page: input type=checkbox name=thisBox value=1 On the processing page: cfparam name=form.thisBox default=0 ..the benefit of this approach is that, should the checkbox be checked on the form page, form.ThisBox is passed to the processing page with a value of 1. When it is _not_ checked, it is not passed to the processing page at all; and the param tells CF that the default value for form.thisBox is 0. Takes care of any problems. The easiest way to do it, especially since I to tend to store checkbox values as BITs in the DB. Kennerly, Rick H CIV wrote: When querying a db where some original input fields were check boxes and were inserted into the db as a binary (yes/no, 1/0, on/off), is the only way to display a check box on the query page, either checked or unchecked, to create a form and add an insert field? If so, I'm having trouble with the conditional logic. Is there an approach I'm overlooking. Rick ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com
Re: Check Boxes - another NUG question
Oh yeah, I may have slightly misunderstood the last question, so to add: The way to do this on the form page is this: input type=checkbox name=thisBox value=1#iif(Query.thisBox, DE(' checked'),DE(''))# ..since it is a boolean we are using as a value, in the IIF, 1 evaluates to true, and 0 to false. Thus only 1s make the checkbox be checked. Randell B Adkins wrote: In the database field you can set the value to anything you want, however you will need to test for the value to properly set the checkboxes on the form to be checked or unchecked. Example: CheckBoxField: Value could be AGREE or DISAGREE on the Form: input type=checkbox name=abc value=Agree CFIF qMyQuery.CheckBoxField EQ 'AGREE'checked/cfif [EMAIL PROTECTED] 11/01/02 10:29AM When querying a db where some original input fields were check boxes and were inserted into the db as a binary (yes/no, 1/0, on/off), is the only way to display a check box on the query page, either checked or unchecked, to create a form and add an insert field? If so, I'm having trouble with the conditional logic. Is there an approach I'm overlooking. Rick ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
Re: Check boxes! dynamic fields??
A couple of ways (off the top of my head): 1. dynamically build a list using javascript, whenever a box is checked. When box is checked (document.formname.fieldname.checked == true), add a value to a list. When a box gets unchecked, remove its value from the list. Pass the list you've built through a hidden form field, then loop through this list on the same page. 2. give the checkbox a naming convention that you can parse over. IE, call it check#id#, or whatever. Then on the next page, do some processing on all fields that begin with check..like: cfloop query="allids" cfif IsDefined("Evaluate("check" id)") !--- do some stuff here --- /cfif /cfloop --- Billy Cravens [EMAIL PROTECTED] -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.