Solved

CFMail Send Checkbox values through email

Posted on 2004-09-15
6
499 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 35

Accepted Solution

by:
mrichmon earned 125 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

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

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

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

690 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