RE: Frigging annoying Checkbox behaviour
IIRC, unticked checkboxes should not exist in the form scope. -Original Message- From: James Holmes [mailto:[EMAIL PROTECTED] Sent: 06 July 2005 11:40 To: CF-Talk Subject: Frigging annoying Checkbox behaviour I vaguely recall reading this somewhere before; when I submit a form full of unticked checkboxes to CF (6.1 in this case), the checkboxes are defined (along with their checked values) in the form structure when I loop through it yet they aren't listed in the FORM.FieldNames variable. This happens in IE6 and FF; of course as long as one or more boxes are ticked the form behaves as is should. I have coded around it by counting the rest of the form fileds and checking the listlength of FORM.FieldNames, so I know when the checkboxes have been left unticked. Is this the expected behaviour from a browser or is something weird going on with CF? -- Geeque - accept the geek within and get your friends off your back - http://www.cafepress.com/geeque/ ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211236 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: Frigging annoying Checkbox behaviour
Kerry wrote: IIRC, unticked checkboxes should not exist in the form scope. Correct: http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2 Jochem ~| Logware (www.logware.us): 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:211239 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: Frigging annoying Checkbox behaviour
So it's a problem with CF or with both browsers. I'll check if it happens in CF 7 too. On 7/6/05, Jochem van Dieten [EMAIL PROTECTED] wrote: Kerry wrote: IIRC, unticked checkboxes should not exist in the form scope. Correct: http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2 Jochem -- Geeque - accept the geek within and get your friends off your back - http://www.cafepress.com/geeque/ ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211246 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: Frigging annoying Checkbox behaviour
James Holmes wrote: So it's a problem It is not a problem, it is the way it works. Jochem ~| Logware (www.logware.us): 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:211247 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: Frigging annoying Checkbox behaviour
I'll restate the behaviour I see: 1) I have a form with multiple checkboxes (with names and values) 2) NONE of them are checked 3) I submit the form 4) They ALL show up in the form scope when I cfloop over the FORM collection This contradicts the W3C reccomendation as I read it. On 7/6/05, Jochem van Dieten [EMAIL PROTECTED] wrote: James Holmes wrote: So it's a problem It is not a problem, it is the way it works. Jochem ~| Logware (www.logware.us): 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:211248 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: Frigging annoying Checkbox behaviour
James Holmes wrote: I'll restate the behaviour I see: 1) I have a form with multiple checkboxes (with names and values) 2) NONE of them are checked 3) I submit the form 4) They ALL show up in the form scope when I cfloop over the FORM collection This contradicts the W3C reccomendation as I read it. That is weird indeed (I thought your problem was that they didn't show up). Is it a self-submitting form? Do you have the liveHTTPheaders plugin for Firefox (it allows you to see the submitted formfields)? Jochem ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211249 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: Frigging annoying Checkbox behaviour
just to double check...you don't have any cfparams on the action page that would instantiate the checkboxes into the form scope? On 7/6/05, James Holmes [EMAIL PROTECTED] wrote: I'll restate the behaviour I see: 1) I have a form with multiple checkboxes (with names and values) 2) NONE of them are checked 3) I submit the form 4) They ALL show up in the form scope when I cfloop over the FORM collection This contradicts the W3C reccomendation as I read it. On 7/6/05, Jochem van Dieten [EMAIL PROTECTED] wrote: James Holmes wrote: So it's a problem It is not a problem, it is the way it works. Jochem ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211250 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: Frigging annoying Checkbox behaviour
Don't worry all; my brain froze up and I forgot to check the input to a query based on the list of values in the checkboxes. Since the list was empty, the input was an empty string, which happens to be the default for that CFC argument, which happens to return the whole list of items. I think I should set a different default... ~| Logware (www.logware.us): 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:211253 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: Frigging annoying Checkbox behaviour
So it's a problem with CF or with both browsers. It's a problem with the HTML standard. There should exist some DEFAULT attribute for controls. ie: INPUT TYPE=checkbox NAME=myCheckBox VALUE=on DEFAULT=off Fortunately, there is a DEFAULT option in CFPARAM -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Logware (www.logware.us): 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:211263 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: Frigging annoying Checkbox behaviour
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Claude Schneegans wrote: So it's a problem with CF or with both browsers. It's a problem with the HTML standard. There should exist some DEFAULT attribute for controls. ie: INPUT TYPE=checkbox NAME=myCheckBox VALUE=on DEFAULT=off Fortunately, there is a DEFAULT option in CFPARAM Is it really a problem? I think the assumption is that the defaults will be supplied on the server anyway seeing as you should check that all the required fields are present as part of validation anyway. That is, after all, part of the reason why cfparam exists. K. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCzAmXmSWF0pzlQ04RAuwJAJoDno/jgmWJ6JcayIxic5nEx+pDjgCgqSK4 81BMPqhEqzpMemPw3LzKRMk= =35Ml -END PGP SIGNATURE- ~| 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:211280 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: Frigging annoying Checkbox behaviour
Is it really a problem? Not really, just something that would be nice in the HTML standard, like some others. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Logware (www.logware.us): 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:211282 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