Re: Checkboxes not passing variables correctly
Steve, We want to help, but without seeing the form code it is almost impossible to troubleshoot. Steve Cutter Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _ http://blog.cutterscrossing.com Steve LaBadie wrote: I have a group of 10 checkboxes where 3 have to be checked. I have a JS script to validate this. The issue at hand is the values are not being passed completely. If you choose Robert Mckenzie the name is passed Robet Mkenzie, any ideas would be appreciated. Steve LaBadie, Web Manager East Stroudsburg University 200 Prospect St. East Stroudsburg, Pa 18301 570-422-3999 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] http://www.esu.edu http://www.esu.edu ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301998 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Checkboxes not passing variables correctly
This is the script to check for 3 checked boxes: script function is_checked() { var formObj = document['internships']['fac']; var count = 0; for (i=0;iformObj.length; i++) { if(formObj[i].type == 'checkbox') if(formObj[i].checked) count++; } if (count 3) { return false; }else { return true; } } function val(){ if (!is_checked()){ alert('You Must Choose 3 Faculty Supervisors'); return false; }else { return true; } } /script trtd align=right valign=topstrongFaculty Supvisor:/strongnbsp;br /font style=color: #BD2925; font-size: xx-small;(Choose 3)/fontnbsp;/tdtd input type=checkbox name=fac value=Joseph Ashcroft /nbsp;Joseph Ashcroftbr / input type=checkbox name=fac value=Paul Lippert /nbsp;Paul Lippertbr / input type=checkbox name=fac value=Charles Warner /nbsp;Charles Warnerbr / input type=checkbox name=fac value=Marcia Godich /nbsp;Marcia Godichbr / input type=checkbox name=fac value=Andrea McClanahan /nbsp;Andrea McClanahan/td tdinput type=checkbox name=fac value=Glenn Geiser-Getz /nbsp;Glenn Geiser-Getzbr / input type=checkbox name=fac value=Robert McKenzie /nbsp;Robert McKenziebr / input type=checkbox name=fac value=Wenji Yan /nbsp;Wenjie Yanbr / input type=checkbox name=fac value=Patricia Kennedy /nbsp;Patricia Kennedybr / input type=checkbox name=fac value=Cem Zeytinoglu /nbsp;Cem Zeytinoglu /td/tr Action page: Faculty Supervisor: cfloop list=#form.fac# index=f delimiters=crlf#f#/cfloop Steve LaBadie, Web Manager East Stroudsburg University 200 Prospect St. East Stroudsburg, Pa 18301 570-422-3999 [EMAIL PROTECTED] http://www.esu.edu -Original Message- Steve LaBadie wrote: I have a group of 10 checkboxes where 3 have to be checked. I have a JS script to validate this. The issue at hand is the values are not being passed completely. If you choose Robert Mckenzie the name is passed Robet Mkenzie, any ideas would be appreciated. Steve LaBadie, Web Manager East Stroudsburg University 200 Prospect St. East Stroudsburg, Pa 18301 570-422-3999 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] http://www.esu.edu http://www.esu.edu ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301999 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Checkboxes not passing variables correctly
No, there's nothing there that would explain it. I'd like to blame it on the font tags, but I can't;) Steve Cutter Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _ http://blog.cutterscrossing.com Steve LaBadie wrote: This is the script to check for 3 checked boxes: script function is_checked() { var formObj = document['internships']['fac']; var count = 0; for (i=0;iformObj.length; i++) { if(formObj[i].type == 'checkbox') if(formObj[i].checked) count++; } if (count 3) { return false; }else { return true; } } function val(){ if (!is_checked()){ alert('You Must Choose 3 Faculty Supervisors'); return false; }else { return true; } } /script trtd align=right valign=topstrongFaculty Supvisor:/strongnbsp;br /font style=color: #BD2925; font-size: xx-small;(Choose 3)/fontnbsp;/tdtd input type=checkbox name=fac value=Joseph Ashcroft /nbsp;Joseph Ashcroftbr / input type=checkbox name=fac value=Paul Lippert /nbsp;Paul Lippertbr / input type=checkbox name=fac value=Charles Warner /nbsp;Charles Warnerbr / input type=checkbox name=fac value=Marcia Godich /nbsp;Marcia Godichbr / input type=checkbox name=fac value=Andrea McClanahan /nbsp;Andrea McClanahan/td tdinput type=checkbox name=fac value=Glenn Geiser-Getz /nbsp;Glenn Geiser-Getzbr / input type=checkbox name=fac value=Robert McKenzie /nbsp;Robert McKenziebr / input type=checkbox name=fac value=Wenji Yan /nbsp;Wenjie Yanbr / input type=checkbox name=fac value=Patricia Kennedy /nbsp;Patricia Kennedybr / input type=checkbox name=fac value=Cem Zeytinoglu /nbsp;Cem Zeytinoglu /td/tr Action page: Faculty Supervisor: cfloop list=#form.fac# index=f delimiters=crlf#f#/cfloop Steve LaBadie, Web Manager East Stroudsburg University 200 Prospect St. East Stroudsburg, Pa 18301 570-422-3999 [EMAIL PROTECTED] http://www.esu.edu -Original Message- Steve LaBadie wrote: I have a group of 10 checkboxes where 3 have to be checked. I have a JS script to validate this. The issue at hand is the values are not being passed completely. If you choose Robert Mckenzie the name is passed Robet Mkenzie, any ideas would be appreciated. Steve LaBadie, Web Manager East Stroudsburg University 200 Prospect St. East Stroudsburg, Pa 18301 570-422-3999 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] http://www.esu.edu http://www.esu.edu ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302004 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Checkboxes not passing variables correctly
This script work correctly, try it. cfif isDefined(Form.submit) cfloop list=#form.fac# index=f delimiters=crlfcfoutput#f#/cfoutput/cfloop /cfif form name=internships action= onsubmit=return val() method=post script function is_checked() { var formObj = document['internships']['fac']; var count = 0; for (i=0;iformObj.length; i++) { if(formObj[i].type == 'checkbox') { if(formObj[i].checked) count++; } } if (count 3) { return false; }else { return true; } } function val(){ if (!is_checked()){ alert('You Must Choose 3 Faculty Supervisors'); return false; }else { return true; } } /script trtd align=right valign=topstrongFaculty Supvisor:/strong br /font style=color: #BD2925; font-size: xx-small;(Choose 3)/font /tdtd br / input type=checkbox name=fac value=Joseph Ashcroft / Joseph Ashcroftbr / input type=checkbox name=fac value=Paul Lippert / Paul Lippertbr / input type=checkbox name=fac value=Charles Warner / Charles Warnerbr / input type=checkbox name=fac value=Marcia Godich / Marcia Godichbr / input type=checkbox name=fac value=Andrea McClanahan / Andrea McClanahanbr input type=checkbox name=fac value=Glenn Geiser-Getz / Glenn Geiser-Getzbr / input type=checkbox name=fac value=Robert McKenzie / Robert McKenziebr / input type=checkbox name=fac value=Wenji Yan / Wenjie Yanbr / input type=checkbox name=fac value=Patricia Kennedy / Patricia Kennedybr / input type=checkbox name=fac value=Cem Zeytinoglu / Cem Zeytinoglu /td/tr input type=submit value=submit name=submit / /form ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302006 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Checkboxes not passing variables correctly
Faculty Supervisor: cfloop list=#form.fac# index=f delimiters=crlf#f#/cfloop that's your problem - your list delimiters. Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Steve LaBadie wrote: I have a group of 10 checkboxes where 3 have to be checked. I have a JS script to validate this. The issue at hand is the values are not being passed completely. If you choose Robert Mckenzie the name is passed Robet Mkenzie, any ideas would be appreciated. Steve LaBadie, Web Manager East Stroudsburg University 200 Prospect St. East Stroudsburg, Pa 18301 570-422-3999 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] http://www.esu.edu http://www.esu.edu ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302007 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Checkboxes not passing variables correctly
delimiters=crlf You're using crlf as delimitior? No wonder c, r, l f are lost. You probably meant CR LF, but these are not the delimiters used to separate field values, the simple comma is used. So just use Faculty Supervisor: cfloop list=#form.fac# index=f#f#/cfloop or more simply: Faculty Supervisor: #form.fac# -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302010 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Checkboxes not passing variables correctly
Is there a list of all possible delimiters value? If I use your suggestion there are no spaces or commas between full names when the information is sent. If I use delimiters=| there is a comma but no space after comma. Steve LaBadie, Web Manager East Stroudsburg University 200 Prospect St. East Stroudsburg, Pa 18301 570-422-3999 [EMAIL PROTECTED] http://www.esu.edu -Original Message- From: Claude Schneegans [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 25, 2008 9:59 AM To: CF-Talk Subject: Re: Checkboxes not passing variables correctly delimiters=crlf You're using crlf as delimitior? No wonder c, r, l f are lost. You probably meant CR LF, but these are not the delimiters used to separate field values, the simple comma is used. So just use Faculty Supervisor: cfloop list=#form.fac# index=f#f#/cfloop or more simply: Faculty Supervisor: #form.fac# -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302013 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Checkboxes not passing variables correctly
What is your desired output? If you just want a straight list with commas between the chosen names, then do as Claude said: Faculty Supervisor: #form.fac# If you need line breaks between the names, then do a loop as Claude said (with a br/ added): cfloop list=#form.fac# index=f #f#br/ /cfloop On Tue, Mar 25, 2008 at 9:12 AM, Steve LaBadie [EMAIL PROTECTED] wrote: Is there a list of all possible delimiters value? If I use your suggestion there are no spaces or commas between full names when the information is sent. If I use delimiters=| there is a comma but no space after comma. Steve LaBadie, Web Manager East Stroudsburg University 200 Prospect St. East Stroudsburg, Pa 18301 570-422-3999 [EMAIL PROTECTED] http://www.esu.edu -Original Message- From: Claude Schneegans [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 25, 2008 9:59 AM To: CF-Talk Subject: Re: Checkboxes not passing variables correctly delimiters=crlf You're using crlf as delimitior? No wonder c, r, l f are lost. You probably meant CR LF, but these are not the delimiters used to separate field values, the simple comma is used. So just use Faculty Supervisor: cfloop list=#form.fac# index=f#f#/cfloop or more simply: Faculty Supervisor: #form.fac# -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302015 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Checkboxes not passing variables correctly
If you just want the list of names, separated by comma and space, then use: Faculty Supervisor: #Replace(form.fac ,all)# On Tue, Mar 25, 2008 at 9:12 AM, Steve LaBadie [EMAIL PROTECTED] wrote: Is there a list of all possible delimiters value? If I use your suggestion there are no spaces or commas between full names when the information is sent. If I use delimiters=| there is a comma but no space after comma. Steve LaBadie, Web Manager East Stroudsburg University 200 Prospect St. East Stroudsburg, Pa 18301 570-422-3999 [EMAIL PROTECTED] http://www.esu.edu -Original Message- From: Claude Schneegans [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 25, 2008 9:59 AM To: CF-Talk Subject: Re: Checkboxes not passing variables correctly delimiters=crlf You're using crlf as delimitior? No wonder c, r, l f are lost. You probably meant CR LF, but these are not the delimiters used to separate field values, the simple comma is used. So just use Faculty Supervisor: cfloop list=#form.fac# index=f#f#/cfloop or more simply: Faculty Supervisor: #form.fac# -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302016 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Checkboxes not passing variables correctly
Is there a list of all possible delimiters value? There only one delimiter: the comma, which is the default delimiter for all list functions, so you don't need to specify one. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302014 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Checkboxes not passing variables correctly
Is there a list of all possible delimiters value? If you want to know more about forms and how values are passed, use CFDUMP var=#form# in your action template and you'll know everything a young lady should know before wedding ;-) -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302017 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Checkboxes not passing variables correctly
Thanks everyone for your input and wisdom. Thanks Claude for the laugh. Steve LaBadie, Web Manager East Stroudsburg University 200 Prospect St. East Stroudsburg, Pa 18301 570-422-3999 [EMAIL PROTECTED] http://www.esu.edu -Original Message- From: Claude Schneegans [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 25, 2008 10:30 AM To: CF-Talk Subject: Re: Checkboxes not passing variables correctly Is there a list of all possible delimiters value? If you want to know more about forms and how values are passed, use CFDUMP var=#form# in your action template and you'll know everything a young lady should know before wedding ;-) -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302018 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Checkboxes not passing variables correctly
the value attrubute of your checkboxes are different from their labels/text? typos? Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Steve LaBadie wrote: I have a group of 10 checkboxes where 3 have to be checked. I have a JS script to validate this. The issue at hand is the values are not being passed completely. If you choose Robert Mckenzie the name is passed Robet Mkenzie, any ideas would be appreciated. Steve LaBadie, Web Manager East Stroudsburg University 200 Prospect St. East Stroudsburg, Pa 18301 570-422-3999 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] http://www.esu.edu http://www.esu.edu ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302025 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Checkboxes not passing variables correctly
Is there a list of all possible delimiters value? A delimeter could be any 'legal' character in a string. The delimeter you use is informed by the string you are given to break up into list items; using different delimiters will break up your 'list' in different ways. Here is some code to demonstrate, just copy and past into a blank template and run it; then look over the output and hopefully things will become clear for you (if they haven't already): cfset myList = foo|bar,sticky toffee pudding|init cfoutput h1Delimiter demo/h1 p The list: #myList#/p h2Using default delimiter (comma)/h2 ul cfloop list=#myList# index=listItem li#listItem#/li /cfloop /ul h2Using '|'/h2 ul cfloop list=#myList# index=listItem delimiters=| li#listItem#/li /cfloop /ul h2Using '|' or ','/h2 ul cfloop list=#myList# index=listItem delimiters=|, li#listItem#/li /cfloop /ul h2Using any vowel/h2 ul cfloop list=#myList# index=listItem delimiters=aeiou li#listItem#/li /cfloop /ul h2Using a character that isn't in the string (@)/h2 ul cfloop list=#myList# index=listItem delimiters=@ li#listItem#/li /cfloop /ul /cfoutput Also, if you want a delimiter of CR LF (used quite regularly to delimit whole lines of a csv that have a line break to indicate a new row) you can use the Chr function: delimiters=#Chr(13)##Chr(10)# HTH Dominic -- Blog it up: http://fusion.dominicwatson.co.uk ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302037 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Checkboxes not passing variables correctly
Thank you Dominic for the extra input, very helpful examples. Steve LaBadie, Web Manager East Stroudsburg University 200 Prospect St. East Stroudsburg, Pa 18301 570-422-3999 [EMAIL PROTECTED] http://www.esu.edu -Original Message- From: Dominic Watson [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 25, 2008 3:53 PM To: CF-Talk Subject: Re: Checkboxes not passing variables correctly Is there a list of all possible delimiters value? A delimeter could be any 'legal' character in a string. The delimeter you use is informed by the string you are given to break up into list items; using different delimiters will break up your 'list' in different ways. Here is some code to demonstrate, just copy and past into a blank template and run it; then look over the output and hopefully things will become clear for you (if they haven't already): cfset myList = foo|bar,sticky toffee pudding|init cfoutput h1Delimiter demo/h1 p The list: #myList#/p h2Using default delimiter (comma)/h2 ul cfloop list=#myList# index=listItem li#listItem#/li /cfloop /ul h2Using '|'/h2 ul cfloop list=#myList# index=listItem delimiters=| li#listItem#/li /cfloop /ul h2Using '|' or ','/h2 ul cfloop list=#myList# index=listItem delimiters=|, li#listItem#/li /cfloop /ul h2Using any vowel/h2 ul cfloop list=#myList# index=listItem delimiters=aeiou li#listItem#/li /cfloop /ul h2Using a character that isn't in the string (@)/h2 ul cfloop list=#myList# index=listItem delimiters=@ li#listItem#/li /cfloop /ul /cfoutput Also, if you want a delimiter of CR LF (used quite regularly to delimit whole lines of a csv that have a line break to indicate a new row) you can use the Chr function: delimiters=#Chr(13)##Chr(10)# HTH Dominic -- Blog it up: http://fusion.dominicwatson.co.uk ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302038 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Checkboxes not checking on edit form
Bruce, Looks like you have your listFind() function backwards. I think you mean : cfif listFind(myList,EmailListArray[x][1])Checked/cfif Also, FYI, in XHTML, it needs to be 'checked=checked' since attributes are lowercase and all attributes must have a value . The input tag should be also self-closed if you're serving an XHTML doctype. HTH, Jon On May 3, 2007, at 5:02 PM, Bruce Sorge wrote: I have this piece of code: table width=100% tr cfset myList = ValueList(qGetCouncilEmailGroupsRet.GroupID) cf_querytoarray Query=listEmailGroupsRet Array=EmailListArray Transpose=Yes AddColumnName=Yes cfloop from=1 to=#ArrayLen(EmailListArray)# index=x cfoutput td width=20 input type=checkbox name=emailgroup value=#EmailListArray[x][1]# cfif ListFind(EmailListArray[x][1], myList) 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 /tr/cfif /cfloop /table This generates X number of checkboxes, and when the table is queried it is supposed to pre-check all of the boxes that are in the table. As long as only one box was checked when the information was input into the databse it works fine. Where it breaks is when you have more than one item checked, then no boxes are checked. I looked into ListGetAt as well and I cannot make this work. When I put in ListGetAt(ValueList(EmailListArray[x][1]), myList) I get an error that it does not like one of the brackets. So what obvious thing am I missing here? Thanks, -- Bruce Sorge I'm a mawg: half man, half dog. I'm my own best friend! ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276969 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Checkboxes not checking on edit form
Jesus, that is the second time I did something stupid like that. Where is captain obvious when you need him? LOL. Thanks, and thanks for the XHTML pointer. Bruce On 5/3/07, Jon Clausen [EMAIL PROTECTED] wrote: Bruce, Looks like you have your listFind() function backwards. I think you mean : cfif listFind(myList,EmailListArray[x][1])Checked/cfif Also, FYI, in XHTML, it needs to be 'checked=checked' since attributes are lowercase and all attributes must have a value . The input tag should be also self-closed if you're serving an XHTML doctype. HTH, Jon ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276970 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: checkboxes
In the recieveing page set up cfparam name=FORM.checkboxname default=false / on the calling page put input type=checkbox name=checkboxname value=true / In your query or whatever do cfif FORM.checkboxname ..do something /cfif On Thu, 20 Jan 2005 15:35:53 -0600, Donna French [EMAIL PROTECTED] wrote: what's the best method for dealing with checkboxes? i want to insert a 1 if checked, a 0 if not. should i set the value in my form, or check the checked status in my insert query and set the value there? i know this should be simple but i've stared at it so long now i've confused myself. tia, donna -- Donna French [EMAIL PROTECTED] Blog: http://dgfrench.blogspot.com Site: http://www.dgfrenchdesigns.com ~| Logware: a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:191276 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: checkboxes
on the form: input type=checkbox name=cbox1 value=1 / (etc) on the action page: cfparam your checkboxes with a default value of 0. if a box is checked, it will override the 0. if it is not checked, it won't be passed and CF will default to the cfparam value. On Thu, 20 Jan 2005 15:35:53 -0600, Donna French [EMAIL PROTECTED] wrote: what's the best method for dealing with checkboxes? i want to insert a 1 if checked, a 0 if not. should i set the value in my form, or check the checked status in my insert query and set the value there? i know this should be simple but i've stared at it so long now i've confused myself. tia, donna -- Donna French [EMAIL PROTECTED] Blog: http://dgfrench.blogspot.com Site: http://www.dgfrenchdesigns.com ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:191279 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: checkboxes
let me read that properly 1 or 0 ok :) cfparam name=FORM.checkboxname default=0 / input type=checkbox name=checkboxname value=1 / cfif FORM.checkboxname ..do something /cfif On Thu, 20 Jan 2005 22:40:57 +0100, Mark Drew [EMAIL PROTECTED] wrote: In the recieveing page set up cfparam name=FORM.checkboxname default=false / on the calling page put input type=checkbox name=checkboxname value=true / In your query or whatever do cfif FORM.checkboxname ..do something /cfif On Thu, 20 Jan 2005 15:35:53 -0600, Donna French [EMAIL PROTECTED] wrote: what's the best method for dealing with checkboxes? i want to insert a 1 if checked, a 0 if not. should i set the value in my form, or check the checked status in my insert query and set the value there? i know this should be simple but i've stared at it so long now i've confused myself. tia, donna -- Donna French [EMAIL PROTECTED] Blog: http://dgfrench.blogspot.com Site: http://www.dgfrenchdesigns.com ~| Logware: a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:191278 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: checkboxes
form action=actfile.cfm input type=checkbox name=ckbox1 value=1 / /form actfile.cfm cfparam name=form.ckbox1 default=0 -Original Message- From: Donna French [mailto:[EMAIL PROTECTED] Sent: Thursday, January 20, 2005 4:36 PM To: CF-Talk Subject: checkboxes what's the best method for dealing with checkboxes? i want to insert a 1 if checked, a 0 if not. should i set the value in my form, or check the checked status in my insert query and set the value there? i know this should be simple but i've stared at it so long now i've confused myself. tia, donna -- Donna French [EMAIL PROTECTED] Blog: http://dgfrench.blogspot.com Site: http://www.dgfrenchdesigns.com ~| Logware: a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:191281 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: checkboxes
Remember that the Form.VarName will only be passed if checked, so in your action page you will need to loop through all possible names to check to see if the Fomr.VarName exists. Andy -Original Message- From: Donna French what's the best method for dealing with checkboxes? i want to insert a 1 if checked, a 0 if not. should i set the value in my form, or check the checked status in my insert query and set the value there? i know this should be simple but i've stared at it so long now i've confused myself. ~| Logware: a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:191281 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: checkboxes
thanks to all - got it and cleared my head a little ;-) Donna On Thu, 20 Jan 2005 15:45:17 -0600, Andy Ousterhout [EMAIL PROTECTED] wrote: Remember that the Form.VarName will only be passed if checked, so in your action page you will need to loop through all possible names to check to see if the Fomr.VarName exists. Andy -Original Message- From: Donna French what's the best method for dealing with checkboxes? i want to insert a 1 if checked, a 0 if not. should i set the value in my form, or check the checked status in my insert query and set the value there? i know this should be simple but i've stared at it so long now i've confused myself. ~| Logware: a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:191291 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Checkboxes in CGI
When a form passes multiple, same-name checkboxes to a CGI script (Perl, C, whatever), what is the raw format of those form field values? Assuming that the form was submitted via HTTP POST using the standard MIME type (application/x-www-urlencoded), they'd be strung together like this: myfield=value1myfield=value2myfield=value3... CF, in its quest to make things as easy for us as possible, makes this into a single variable with a comma-delimited list. But if you've enabled debug output or reference Form.Fieldnames directly, you can see the repeated field name in the Form.Fieldnames variable also created by CF. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~| 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 Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: checkboxes to action pages
Mike I assume the check boxes represent the same field in the database? So for example you might have three checkboxes for 3 employees called Andy, Mike and Steve and you want to delete the employees whose box is checked? If this is the case then.. All of your boxes should be called the same name but each should have a different value representing the item in question. so for the above example your 3 checkboxes would all be called name but would have 3 integer values - 1,2,3 representing Andy, Steve and Mike respectively (if that was their reoresentation within the db). Then in the action page, if you had checked all three the value of form.name would be 1,2,3. Your SQL statement would then be something DELETE * FROM employee WHERE ID IN (#form.name#). If your checkboxes contain text values then this becomes a bit more tricky as the SQL statement would require single quotes around each element in the list. HTH -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Michael Vinson [mailto:[EMAIL PROTECTED]] Sent: 18 September 2001 15:34 To: CF-Talk Subject: checkboxes to action pages Hi, I have a list of records (to delete) with checkboxes. i.e. user wants to delete recs clicks checkbox Once the user clicks submit (Delete) Here's what I know: - How many items in the list - My 'index' to the list (using email address), which contains a subset of the query displayed in the form. Note that the number of email addresses I capture is equal to the total number of items in list. Here's what do not know: - How to match my form checkbox name (delChecked) to my data as described above! The parameters that get passed to my 'action page' reveal (to me, at least) a compressed list showing data (e.g. on,on,on) but how in the world do I match this to... item 1 checked, item 3 checked, item 5 checked Ain't learning great! Thank in advance ... -Mike ~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: checkboxes to action pages
Thanks Andy, I simply indexed my checkbox value (1,2,3...) inside a cfloop voila' I have my number(ed) values which correspond to the checkboxes. This technique will have to do... But I would still like to figure how to pass the array of checked values (e.g. 0,0,1,1...) to my action page. Oh well, on to the next snag :-) -mv Andy Ewings wrote: snipAll of your boxes should be called the same name but each should have a different value representing the item in question. so for the above example your 3 checkboxes would all be called name but would have 3 integer values - 1,2,3 representing snip ~~ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: checkboxes to action pages
instead of having the checkbox have a value of no, let it have a numeric value which could be an ID, or an increment and u can trace it back to the list :) From: Michael Vinson [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Subject: checkboxes to action pages Date: Tue, 18 Sep 2001 10:33:40 -0400 Hi, I have a list of records (to delete) with checkboxes. i.e. user wants to delete recs clicks checkbox Once the user clicks submit (Delete) Here's what I know: - How many items in the list - My 'index' to the list (using email address), which contains a subset of the query displayed in the form. Note that the number of email addresses I capture is equal to the total number of items in list. Here's what do not know: - How to match my form checkbox name (delChecked) to my data as described above! The parameters that get passed to my 'action page' reveal (to me, at least) a compressed list showing data (e.g. on,on,on) but how in the world do I match this to... item 1 checked, item 3 checked, item 5 checked Ain't learning great! Thank in advance ... -Mike ~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: checkboxes
Something like: update blah where something set ( cfif isdefined(form.status) Status, /cfif values ( cfif isdefined(form.status) 1 cfelse 0 /cfif Basically, if the form field exists then the user has checked the box. HTH, Howie Hamlin - inFusion Project Manager On-Line Data Solutions, Inc. www.CoolFusion.com 631-737-4668 x101 inFusion Mail Server (iMS) - The Intelligent Mail Server Join the DevCon community at www.coolfusion.com/devcon - Original Message - From: Jones, Becky [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, July 03, 2001 4:19 PM Subject: checkboxes i have a form that has a list of articles. and next to each article there is a checkbox. and it displays that it is checked like so: input type=Checkbox name=Status cfif #status# eq 1checked/cfif value=1 if the article is live does anyone know how i would write the update statement? ive tried everything, and i cant get it to work. thanks, bec. * This e-mail, including any attachments, is intended for the receipt and use by the intended addressee(s), and may contain confidential and privileged information. If you are not an intended recipient of this e-mail, you are hereby notified that any unauthorized use or distribution of this e-mail is strictly prohibited. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Checkboxes define tables...
If each form field is named services then the value of Form.Services will be a list of all the checkboxes selected. So, if you had this: INPUT TYPE=checkbox NAME=Services VALUE=11 INPUT TYPE=checkbox NAME=Services VALUE=22 INPUT TYPE=checkbox NAME=Services VALUE=33 and the user selected 1 and 3, the value of Form.Services would be 1,3. Now, you ask, how can I tell it to write something like 'on' in each services field that's check. Are you asking about how to make them preselected when the form redisplays? Or how to save them to a DB? If you want to know how to make them preselected, simply... CFPARAM NAME=Form.Selected DEFAULT= INPUT TYPE=checkbox NAME=Services VALUE=1 CFIF ListFind(Form.Selected,1)CHECKED/CFIF1 INPUT TYPE=checkbox NAME=Services VALUE=2 CFIF ListFind(Form.Selected,2)CHECKED/CFIF2 INPUT TYPE=checkbox NAME=Services VALUE=3 CFIF ListFind(Form.Selected,3)CHECKED/CFIF3 and so on. Does this help? === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email : [EMAIL PROTECTED] ICQ UIN : 3679482 My ally is the Force, and a powerful ally it is. - Yoda -Original Message- From: Tony Hicks [mailto:[EMAIL PROTECTED]] Sent: Monday, May 21, 2001 7:35 AM To: CF-Talk Subject: Checkboxes define tables... I have a form with 13 checkboxes each named Services but with different values.. is there a way i can tell it to write something like 'on' in each services field that's checked from the form? Without alot of useless cfifs and stuff? Thanks, Tony Hicks ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: checkboxes
give them all the same name. any checked will be returned as members of a list( of values). If one is checked, one is returned. Be sure to use CFPARAM or some other code to handle if nothing was checked. ~Simon -Original Message- From: Peter Benoit [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 25, 2000 9:58 AM To: CF-Talk Subject: checkboxes Hi, I have 5 checkboxes on a form, and I want to submit to a database only the box that was checked. How can I do this? Thanks Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
RE: checkboxes
You can use radio buttons to better do what you wish. Something like: input type="Radio" name="itemsselected" value="1" input type="Radio" name="itemsselected" value="2" input type="Radio" name="itemsselected" value="3" input type="Radio" name="itemsselected" value="4" input type="Radio" name="itemsselected" value="5" This way when the 2nd one is checked the first one becomes 'unchecked'. Thus the value is now 2. If you must use check boxes, I would do something like: input type="Checkbox" name="thisbox1" value="1" input type="Checkbox" name="thisbox2" value="2" input type="Checkbox" name="thisbox3" value="3" input type="Checkbox" name="thisbox4" value="4" input type="Checkbox" name="thisbox5" value="5" Only problem is when you test to see if thisbox1 isdefined and insert it into the DB, what happens is if both box 1 and 2 was checked. Thus I would use the radio buttons. HTH Randy -Original Message- From: Peter Benoit [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 25, 2000 9:58 AM To: CF-Talk Subject: checkboxes Hi, I have 5 checkboxes on a form, and I want to submit to a database only the box that was checked. How can I do this? Thanks Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
RE: checkboxes
You Idiot Randy! It was nice to see another solution to the opposite of his problem, however he did say he wanted a list of the selected items and radio buttons don't allow multiple selections as you point out:-) regards Andrew Scott Senior Cold Fusion Application Developer ANZ eCommerce Centre * Ph 9273 0693 * [EMAIL PROTECTED] -Original Message- From: Randy Adkins [mailto:[EMAIL PROTECTED]] Sent: 26 October 2000 01:09 To: CF-Talk Subject: RE: checkboxes You can use radio buttons to better do what you wish. Something like: input type="Radio" name="itemsselected" value="1" input type="Radio" name="itemsselected" value="2" input type="Radio" name="itemsselected" value="3" input type="Radio" name="itemsselected" value="4" input type="Radio" name="itemsselected" value="5" This way when the 2nd one is checked the first one becomes 'unchecked'. Thus the value is now 2. If you must use check boxes, I would do something like: input type="Checkbox" name="thisbox1" value="1" input type="Checkbox" name="thisbox2" value="2" input type="Checkbox" name="thisbox3" value="3" input type="Checkbox" name="thisbox4" value="4" input type="Checkbox" name="thisbox5" value="5" Only problem is when you test to see if thisbox1 isdefined and insert it into the DB, what happens is if both box 1 and 2 was checked. Thus I would use the radio buttons. HTH Randy -Original Message- From: Peter Benoit [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 25, 2000 9:58 AM To: CF-Talk Subject: checkboxes Hi, I have 5 checkboxes on a form, and I want to submit to a database only the box that was checked. How can I do this? Thanks Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
RE: checkboxes
Hey, it's that nice banker again ;-) -Original Message- From: Scott, Andrew [mailto:[EMAIL PROTECTED]] You Idiot Randy! ... regards Andrew Scott Senior Cold Fusion Application Developer ANZ eCommerce Centre * Ph 9273 0693 * [EMAIL PROTECTED] IMPORTANT NOTICE: This e-mail and any attachment to it is intended only to be read or used by the named addressee. It is confidential and may contain legally privileged information. No confidentiality or privilege is waived or lost by any mistaken transmission to you. If you receive this e-mail in error, please immediately delete it from your system and notify the sender. You must not disclose, copy or use any part of this e-mail if you are not the intended recipient. The RTA is not responsible for any unauthorised alterations to this e-mail or attachment to it. Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
Re: checkboxes in a list
Greg, Assuming your list of user id's is also named 'userPermissions', try: input type="checkbox" name="userPermissions" value="userID"cfif ListFindNoCase(userPermissions, userID) checked/cfif#userID# Jim -Original Message- From: Albert, Gregory Mitchell (Greg) [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Date: Monday, September 25, 2000 10:30 PM Subject: checkboxes in a list I am designing an administration area and I need to assign a single page to multiple people. Because I don't know how many people will need access and because I'll be adding/deleting people all the time, I need to make all of the values go into the same field (userPermissions) in the database. The "pages" table has the following fields: pageID, pageDescription, userPrivileges. My code looks something like this: cfoutput input type="checkbox" name="userPrivileges" value="#userID#"#userID# /cfoutput I can submit these values without a problem. A comma-delimited list is inserted into the DB. My problem is that when I try to edit the page to change permissions, I can't see who was selected (or checked) before and who wasn't. I know this is a common problem, but I haven't been able to find any articles that really explain the problem I'm running into. I know it's something simple that I'm just not seeing. Can anyone shed some light on my problem? Thanks in advance! Greg Albert -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 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.
RE: checkboxes in a list
Run a cfloop on the list then do a comparison against the person if it matches then do a checked on the input type:-) regards Andrew Scott ANZ eCommerce Centre * Ph 9273 0693 * [EMAIL PROTECTED] -Original Message- From: Albert, Gregory Mitchell (Greg) [mailto:[EMAIL PROTECTED]] Sent: 26 September 2000 15:30 To: CF-Talk Subject: checkboxes in a list I am designing an administration area and I need to assign a single page to multiple people. Because I don't know how many people will need access and because I'll be adding/deleting people all the time, I need to make all of the values go into the same field (userPermissions) in the database. The "pages" table has the following fields: pageID, pageDescription, userPrivileges. My code looks something like this: cfoutput input type="checkbox" name="userPrivileges" value="#userID#"#userID# /cfoutput I can submit these values without a problem. A comma-delimited list is inserted into the DB. My problem is that when I try to edit the page to change permissions, I can't see who was selected (or checked) before and who wasn't. I know this is a common problem, but I haven't been able to find any articles that really explain the problem I'm running into. I know it's something simple that I'm just not seeing. Can anyone shed some light on my problem? Thanks in advance! Greg Albert -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 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. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 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.
RE: Checkboxes....
This has almost certainly been asked before... Yesterday in fact :-) The thread is called "picking up form variables on the action page??" Nick ** Information in this email is confidential and may be privileged. It is intended for the addressee only. If you have received it in error, please notify the sender immediately and delete it from your system. You should not otherwise copy it, retransmit it or use or disclose its contents to anyone. Thank you for your co-operation. ** -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 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.
RE: Checkboxes....
Nick, Yesterday in fact :-) The thread is called "picking up form variables on the action page??" Thing is I only rejoined the list today. I can see one tail end of that thread but it is only talking about checking the existance of FORM varaiables. Perhaps the start oif the thread refered to my question but I cannot access those messages (they do not seem to be in the archives yet) My question is to do with passing checkbox FORM variables whose names are dynamically generated in the form. I can't send them as as an array (I guess a form variable cannot be an array ... I experimented and it didn't work) without resorting to WDDX or somesuch so I am sending them as Item_1Item_n My problem is is looping through those in the next template and inserting their values into the database. I am trying to write the ones that get passed to an array and then looping through that to do the inserts but it is clunky and anyway doesn't work at the moment. Graham -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 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.
RE: Checkboxes....
Thing is I only rejoined the list today. Sorry Graham, will forward you the thread off list. Nick ** Information in this email is confidential and may be privileged. It is intended for the addressee only. If you have received it in error, please notify the sender immediately and delete it from your system. You should not otherwise copy it, retransmit it or use or disclose its contents to anyone. Thank you for your co-operation. ** -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 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.
RE: Checkboxes....
Nick, Many many thanks for digging out the thread messages and sending them to me. You are right this is the same question. I don't entirely understand the answer though: cfset thelist= "" cfform cfinput name="Reference_#ReferenceID#" Submit cfset thelist = thelist reference "," /cfform I would have a loop within the cfform as I guess is implied above How do the values of the selected checkboxes get added to the list before the submit button is pressed and how is that list passed to the next template - as an INPUT Type=hidden ? or are we ignoring the normal checkbox FORM values and using the list instead? Graham This has almost certainly been asked before... Yesterday in fact :-) The thread is called "picking up form variables on the action page??" -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 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.
Re: Checkboxes Update
Hi Jeff, well on your display page you want to do several things 1) name all your checkboxes the same (that way a single variable, called FORM.yourcheckboxname will get passed to the action page 2) generate a list of the currently checked items (the ones checked before the user starts toggling). Store in a hidden field, since you will want to use this later on the action page. If you get these from a DB then you can just convert the query to a list. For example you have a list of categorys and the persons has some favorites already chosen. You get these from a DB and also convert it as well as a query of *all* the categories. Loop thru the full list and for each one if CategoryID is also part of the user-chosen list you just made then set its value to CHECKED. This gets you a full display of all the checkboxes with the ones previously checked now pre-checked. You've also stored the previously checked ones in a list variable in a hidden field of the form. 3) on the action page do this: oldlist is a list of your previously chosen categorys. Newlist comes directly from the checkboxes all being named the same---and only the ones that are checked when the form gets submitted will come thru. Then compare as below to see what is new and what is old, updating the DB throughout. !--- do group distribution here --- cfset oldlist = ATTRIBUTES.UserCategoryIDList cfset newlist = ATTRIBUTES.Category_ID !--- if an item appears in the new list but not in the old then add it to the table --- cfloop list="#newlist#" index="item" DELIMITERS="," cfif ListContains(oldlist,item) EQ 0 CFQUERY DATASOURCE="#APPLICATION.dsn#" NAME="additem" INSERT INTO Persons2Categorys ( PersonID, CategoryID ) VALUES ( #SESSION.User.ID#, #item# ) /CFQUERY /cfif /cfloop !--- if an item appears in the old list but not in the new then delete it from the table --- cfloop list="#oldlist#" index="item" DELIMITERS="," cfif ListContains(newlist,item) EQ 0 CFQUERY DATASOURCE="#APPLICATION.dsn#" NAME="deleteitem" DELETE FROM Persons2Categorys WHERE 0=0 AND CategoryID = #item# AND PersonID = #SESSION.User.ID# /CFQUERY /cfif /cfloop hope that helps. - Original Message - From: Jeffrey M. Placzek [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 12, 2000 11:07 PM Subject: Checkboxes Update This is a multi-part message in MIME format. --=_NextPart_000_0029_01BFA4CB.75848A40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable This may be a basic question but... I need to update multiple checkboxes on an update form... how do I get = it to pass the checked or unchecked state to the update form? or radio = buttons? or drop down menus? In desperate need.. all you pros please respond to my email address = right away if you can Insanity is about to set in. help... -Jeff --=_NextPart_000_0029_01BFA4CB.75848A40 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" HTMLHEAD META content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR STYLE/STYLE /HEAD BODY bgColor=3D#ff DIVFONT face=3DArial size=3D2This may be a basic question = but.../FONT/DIV DIVnbsp;/DIV DIVFONT face=3DArial size=3D2I need to update multiple checkboxes on = an update=20 form... how do I get itnbsp;to pass the checked or unchecked state to = the=20 update form? or radio buttons? or drop down menus?/FONT/DIV DIVFONT face=3DArial size=3D2In desperate need.. all you pros please = respond to=20 my email address right away if you can/FONT/DIV DIVFONT face=3DArial size=3D2Insanity is about to set in.=20 help.../FONT/DIV DIVnbsp;/DIV DIVFONT face=3DArial size=3D2-Jeff/FONT/DIV/BODY/HTML --=_NextPart_000_0029_01BFA4CB.75848A40-- -- 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. -- 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.