?
Solved

CFMail Send Checkbox values through email

Posted on 2004-09-15
6
Medium Priority
?
504 Views
Last Modified: 2013-12-24
Hello,

I have a series of checkboxes.  For example:

<input name="cdEasel" type="checkbox" id="cdEasel" value="Easel">Easel
<input name="cdFlipchart" type="checkbox" id="cdFlipchart" value="Flipchart">Flipchart
<input name="cdLCD" type="checkbox" id="cdLCD" value="LCD Projector">LCD Projector

I am sending email like this:
      <cfmail from=#txtEmail# to="name@biz.com" subject="Room Reservation">
       From: #txtFullName#
       Phone: #txtPhone#
       Email: #txtEmail#
       Name of event: #txtName#
       Date: #sltMonth#/#sltDay#/#sltYear#
       Number of People: #txtNumber#
       Time(s) Room is Needed: #txtTimes#
       Room Configuration: #rbConfig#
                 Equipment Needed: THIS IS WHERE I WOULD LIKE TO LOOP THROUGH THE CHECK BOXES ABOVE.              
      </cfmail>

How can I loop through the series of checkboxes and send the values of those checkboxes via the cfmail?

Thank you.
0
Comment
Question by:rudyflyer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 21

Expert Comment

by:pinaldave
ID: 12066280
Hi rudyflyer,
you can not loop inside the CFMAIL. you will have to do it outside...

Regards,
---Pinal
0
 

Author Comment

by:rudyflyer
ID: 12066322
I am very new to CF.  How do I do the loop and then send it via email?

Thank you
0
 
LVL 21

Expert Comment

by:pinaldave
ID: 12066364
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 35

Accepted Solution

by:
mrichmon earned 500 total points
ID: 12067931
It looks like you are not actually "looping"

Try this :

 <cfmail from=#txtEmail# to="name@biz.com" subject="Room Reservation">
      From: #txtFullName#
      Phone: #txtPhone#
      Email: #txtEmail#
      Name of event: #txtName#
      Date: #sltMonth#/#sltDay#/#sltYear#
      Number of People: #txtNumber#
      Time(s) Room is Needed: #txtTimes#
      Room Configuration: #rbConfig#
                 Equipment Needed:
                      <cfif  IsDefined("Form.cdEasel")> Easel</cfif>
                      <cfif  IsDefined("Form.cdFlipchart")> Flipchart</cfif>
                      <cfif  IsDefined("Form.cdLCD")> LCD Projector</cfif>
     </cfmail>

0
 
LVL 5

Expert Comment

by:kkhipple
ID: 12075314
isn't it better practice to have something like this?

<!----basically check and verify FORM element exist and does have a value besides the empty string and then output the FORM element value --->

<CFIF IsDefined("FORM.cdEasel") AND FORM.cdEasel NEQ "">#FORM.cdEasel#</CFIF>
<CFIF IsDefined("FORM.cdFlipchart") AND FORM.cdFlipChart NEQ "">#FORM.cdFlipChart#</CFIF>
<CFIF IsDefined("FORM.cdLCD") AND FORM.cdLCD NEQ "">#FORM.cdLCD#</CFIF>
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 12075554
not necessary at all for checkboxes.

They are either defined if they were checked or not defined it they were not checked.

Now what you could do is :

<cfparam name="Form.cdEasel" type="numeric" default="0">

And it will be 1 if the box was checked and 0 otherwise.

But really you can just check if the variable name is defined and that is good enough.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question