Forums

Checkbox & Radio Selections NOT appearing in email.

sizex 13 Feb, 2009
I am having a problem with my checkbox and radio selections not appearing in email instead i get just repeats of the same things but not a selection as to which one of these was chosen. I know other people are having the same problem but I couldn't make heads or tails out of the solutions provided to them. The code for the fields are as follows.
<div  class="form_item"><div class="form_element cf_checkbox"><label class="cf_label">Preferred Contact Method</label><div class="float_left"><input value=" Email" class="radio validate-one-required" id="_Email" name="_Email" type="checkbox"><label for="_Email" class="check_label"> Email</label><br><input value=" Phone" class="radio" id="_Phone" name="_Phone" type="checkbox"><label for="_Phone" class="check_label"> Phone</label><br><input value=" Mail" class="radio" id="_Mail" name="_Mail" type="checkbox"><label for="_Mail" class="check_label"> Mail</label><br></div><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a><div  class="tooltipdiv">Preferred Contact Method :: Please select how you would prefer to be contacted</div></div><div class="clear"> </div></div>

<div  class="form_item"><div class="form_element cf_radiobutton"><label class="cf_label">Preferred Contact Time</label><div class="float_left"><input value=" Morning" class="radio validate-one-required" id="_Morning0" name="radio0" type="radio"><label for="_Morning0" class="radio_label"> Morning</label><br><input value=" Afternoon" class="radio" id="_Afternoon0" name="radio0" type="radio"><label for="_Afternoon0" class="radio_label"> Afternoon</label><br><input value=" Evening" class="radio" id="_Evening0" name="radio0" type="radio"><label for="_Evening0" class="radio_label"> Evening</label><br></div><a onclick="return false;" class="tooltiplink"><img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a><div  class="tooltipdiv">Preferred Contact Time :: Please select which time you would prefer us to contact you.</div></div><div class="clear"> </div></div>

and the email template is coming out like this:

Preferred Contact Method
{_Email} Email
{_Phone} Phone
{_Mail} Mail
Preferred Contact Method :: Please select how you would prefer to be contacted

Preferred Contact Time
{radio0} Morning
{radio0} Afternoon
{radio0} Evening


Is someone able to help me please. 😀
GreyHead 13 Feb, 2009
Hi sizex,

The basic process here is to make all the checkboxes return an array of results by giving them all the same array name like contact[]
<div  class="form_item">
  <div class="form_element cf_checkbox">
    <label class="cf_label">Preferred Contact Method</label>
    <div class="float_left">
      <input value=" Email" class="radio validate-one-required" id="_Email" name="contact[]" type="checkbox">
      <label for="_Email" class="check_label"> Email</label>
      <br>
      <input value="Phone" class="radio" id="Phone" name="contact[]" type="checkbox">
      <label for="Phone" class="check_label"> Phone</label>
      <br>
      <input value="Mail" class="radio" id="Mail" name="contact[]" type="checkbox">
      <label for="Mail" class="check_label"> Mail</label>
      <br>
    </div>
    <a onclick="return false;" class="tooltiplink">
      <img  src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16">
    </a>
    <div  class="tooltipdiv">Preferred Contact Method :: Please select how you would prefer to be contacted</div>
  </div>
  <div class="clear"> </div>
</div>
and then use a simpler version in the template:
<div  class="form_item">
     <label class="cf_label">Preferred Contact Method</label>{contact}
<div >

Bob
sizex 14 Feb, 2009
ahhhh thanks so much. now its working like a charm.
😀
This topic is locked and no more replies can be posted.