Checkbox results in Email Template

mcmoody 03 Sep, 2009
I'll try to make this simple. My form is here: http://www.freightfirstcorporation.com/NEW/quote

My form code for checkboxes is:
<p><strong>What Equipment Type Are You  Interested In? </strong><br />
  <em>Check All That Apply</em><br />
    <input type="checkbox" name="equiptype" value="semi" />    Semi<br />
  <input type="checkbox" name="equiptype"  value="tractor" />   Tractor Only<br />
  <input type="checkbox" name="equiptype"  value="tractortrailer" /> Tractor And Trailer<br />
<input type="checkbox" name="equiptype"  value="straighttruck" /> Straight  Truck<br />
<input type="checkbox" name="equiptype"  value="driveronly" /> Driver  Only</p>


The email template is:
What Equipment Type Are You Interested In?
{equiptype}


The email template results only returns the LAST checkbox result. Does each NAME have to be unique? equiptype1, equiptype2? If so, how do I make the email template display ONLY value results from checked boxes and not the code {equiptype1} when {equiptype1} was left unchecked?

I think my problem might have a simple solution - maybe missing form code?

Martha
GreyHead 03 Sep, 2009
Hi Martha,

For Checkbox arrays and Multiple Select boxes you need to use array names like name="equiptype[]" and set ChronoForms to handle array results for you (on the General Tab I think).

Bob
mcmoody 03 Sep, 2009
Thank you! The [ ] part of the array was the missing ingredient. It works!
wmuckell 25 Nov, 2009
I've set all my checkboxes to be name="fieldname[]"

But on the email template I am still getting {fieldname} appear when I email results if not selected. If selected it puts a 1 there. Really I would like this to say YES or NO.

Array handling set to yes. Any suggestions?
GreyHead 25 Nov, 2009
Hi wmuckell,

What is the 'value' attribute set to in your checkbox inputs?

Bob
wmuckell 27 Nov, 2009
  <input name="Visitor_Guides[]" type="checkbox" id="Visitor_Guides" value="yes" class="cb" />


Here is one of the checkboxes, they are all similar. If not checked the result in the email will be {Visitor_Guides} which the sales team can't cope with!!!!
Max_admin 29 Nov, 2009
Hi wmuckell,

If they are not checked you get the {Visitor_Guides} and if any is chekced your get the results ? if yes then this is a known bug with the current release, please contact me through the "contact us" page to get a one file patch!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.