macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

Re: checkboxes & radio button with cfmail

Subject: Re: checkboxes & radio button with cfmail
From: "Dan Bracuk"
Date: Wed, 22 Aug 2007 18:53:17 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
[q][i]Originally posted by: [b][b]JRLobdell[/b][/b][/i]
 Hi Dan,

 Yes it does work with 1 checkbox but if there is more that one checkbox I get 
the error even though it is defined in cfparam.  What csuses this and do you 
know hoe I can correct it?
 Best,
 Joy[/q]
 The cause is that when html forms are submitted, any unchecked checkboxes or 
radio buttons will not be included in the submission.  On your action page, 
form.checkbox_field simply won't exist.

 There are a variety of solutions.  They include:
 On your form, precede each checkbox with a hidden field of the same name.  
Then on your action page, use the listlast() function.
 or
 Use cfparam on your action page for every checkbox and radio button
 or
 Use isDefined() on your action page for every checkbox and radio button




<Prev in Thread] Current Thread [Next in Thread>