Forums

Checkbox data not showing in email

nicolaf 08 Oct, 2010
Hi, I am having problems getting my checkbox data to show up in the email. I have been through the forum and tried the things you suggested, but I must have missed something because it still isn't working for me. Their checkbox selection is not showing in the email, only {check0}

This is my form code for the checkboxes:
<div class="form_item">
  <div class="form_element cf_checkbox ">
    <label class="cf_label" style="width: 200px;">Preferred Consultation Day:</label>
    <div class="float_left">
      <input value="Wednesday" title="" class="radio" id="check00" name="check0[]" type="checkbox" />
      <label for="check00" class="check_label" style="padding-left:20px;">Wednesday 10-4pm</label>
      <br />
      
<input value="Thursday" title="" class="radio" id="check01" name="check0[]" type="checkbox" />
      <label for="check01" class="check_label" style="padding-left:20px;">Thursday 10-4pm</label>
      <br />
      
<input value="Friday" title="" class="radio" id="check02" name="check0[]" type="checkbox" />
      <label for="check02" class="check_label" style="padding-left:20px;">Friday 10-4pm</label>
      <br />
      
<input value="Saturday" title="" class="radio" id="check03" name="check0[]" type="checkbox" />
      <label for="check03" class="check_label" style="padding-left:20px;">Saturday 9-12pm</label>
      <br />
      
<input value="Sunday" title="" class="radio" id="check04" name="check0[]" type="checkbox" />
      <label for="check04" class="check_label" style="padding-left:20px;">Sunday (special appointment only)</label>
      <br />
      

    </div>
    
  </div>
  <div class="cfclear"> </div>
</div>

The code for the email template is as follows:
Preferred Consultation Day: {check0}

The "Chronoforms handle my posted arrays" is set ON.

What have I missed?
Thanks Nicola
GreyHead 08 Oct, 2010
Hi Nicola,

This all looks good. I'm not sure why it isn't working.

Please turn debug on in the form General Tab, then submit the form and post the debug - including the 'dummy emails' results here.

Bob
nicolaf 08 Oct, 2010
Hi Bob, here is the debug info. I have masked out email and web addresses for privacy.
Thanks, Nicola

From: Admin - xxx[info@xx.com.au]
To: [email]info@xxx.com.au[/email]
CC:
BCC:
Subject: Consultation Request from xxx website

Consultations are available Wednesday-Friday between 10-4pm, Saturdays 9-12, and Sunday by special appointment. Please enter the following information if you wish to make a consultation appointment, and we will be in touch as soon as we can.

Names: Bride and Groom Nicola Fleming

Wedding Date: 9/10/2010

Wedding Venue: wedding venue

Mobile: 0408734533

Email: [email]nicola@xxx.com[/email]

Preferred Consultation Day: {check0}


How Did You Hear About Us: Friend



Verify: {imageverification}




Submitted by 60.228.224.147

Files:

1.Form passed first SPAM check OK
2.Form passed the submissions limit (if enabled) OK
3.Form passed the Image verification (if enabled) OK
4.Form passed the server side validation (if enabled) OK
5.$_POST Array: Array ( [names] => Nicola Fleming [weddingdate] => 9/10/2010 [venue] => wedding venue [mobile] => 0408734533 [email] => [email]nicola@xxx.com[/email] [hearabout] => Friend [chrono_verification] => AyVwn [button_11] => Submit [c5e02f7e650bf3544ed8b8603c1ed8a1] => 1 [1cf1] => 5bea2d2596d08ab017e2cc146b89f760 [chronoformname] => consultation )
6.$_FILES Array: Array ( )
7.Form passed the plugins step (if enabled) OK
8.An email has been SENT successfully from (Admin - Wedding Flowers in Maleny)info@xxx.com.au to [email]info@xxx.com.au[/email]
9.Debug End
10.Redirect link set, click to test:
http://www.weddingflowersinmaleny.com.au/index.php?option=com_content&view=article&id=116&Itemid=112

GreyHead 09 Oct, 2010
Hi Nicola,

Curious, there is no date for check0 in the example you posted
5.$_POST Array: Array ( 
[names] => Nicola Fleming 
[weddingdate] =>  9/10/2010 
[venue] => wedding venue 
[mobile] => 0408739999 
[email] => nicola@xxx.com  
[hearabout] => Friend 
[chrono_verification] => AyVwn 
[button_11] => Submit 
[c5e02f7e650bf3544ed8b8603c1ed8a1] => 1 
[1cf1] => 5bea2d2596d08ab017e2cc146b89f760 
[chronoformname] => consultation ) 
And you'd expect {check0} to show in the template after this. To prevent it you need to add some code to the OnSubmit Before Box
<?php
$check0 = JRequest::getVar('check0', 'nothing checked', 'post');
JRequest::setVar('check0', $check0);
?>
This just makes sure that there is always a value set for check0 even if nothing is checked.

I have looked the form and check0 appears to be being returned correctly if the boxes are checked.
(Congratualtions on getting the RokCheckboxes to work with ChronoForms.)

Bob

PS Having the same email address in the To & From Email boxes sometimes causes emails to be dropped; safer to use two different addresses.
nicolaf 09 Oct, 2010
Hi Bob,
Still no good. Here is the debug data. I put the code in the Submit Box - Before sending Email as suggested.
When I filled out the form I ticked Thursday, so it shouldn't say nothing checked.

From: Admin - [admin@xxx.com.au]
To: [email]info@xxx.com.au[/email]
CC:
BCC:
Subject: Consultation Request from xxx website

Consultations are available Wednesday-Friday between 10-4pm, Saturdays 9-12, and Sunday by special appointment. Please enter the following information if you wish to make a consultation appointment, and we will be in touch as soon as we can.

Names: Bride and Groom Nicola Fleming

Wedding Date: 9/10/2010

Wedding Venue: wedding venue test

Mobile: 04239848400

Email: [email]nicola@xxx.com.au[/email]

Preferred Consultation Day: nothing checked


How Did You Hear About Us: MSN



Verify: {imageverification}




Submitted by 60.228.224.147

Files:

1.Form passed first SPAM check OK
2.Form passed the submissions limit (if enabled) OK
3.Form passed the Image verification (if enabled) OK
4.Form passed the server side validation (if enabled) OK
5.$_POST Array: Array ( [names] => Nicola Fleming [weddingdate] => 9/10/2010 [venue] => wedding venue test [mobile] => 04239848400 [email] => [email]nicola@xxx.com.au[/email] [hearabout] => MSN [chrono_verification] => RM6VC [button_11] => Submit [cf8b5bfe3c75383c8dc9a080a50b3845] => 1 [1cf1] => 33266ad16d046634329d0202cb8ca875 [chronoformname] => consultation )
6.$_FILES Array: Array ( )
7.Form passed the plugins step (if enabled) OK
8.An email has been SENT successfully from (Admin - Wedding Flowers in Maleny)admin@xxx.com.au to [email]info@xxx.com.au[/email]
9.Debug End
10.Redirect link set, click to test:
http://www.xxx.com.au/index.php?option=com_content&view=article&id=116&Itemid=112
GreyHead 09 Oct, 2010
Hi Nicola,

Very odd, please will you turn Debug back on and try submitting from the bare form here.

I'm wondering if the RokForm settings are affecting this - I don't think so but let's eliminate them.

Bob
nicolaf 09 Oct, 2010
Bingo! Your guess was correct! The "Preferred Day" is contained in the email template when bare form is used.
Now, what is RokForms and how do I work around it??

From: Admin - Wedding Flowers in Maleny [admin@xxx.com.au]
To: [email]info@xxx.com.au[/email]
CC:
BCC:
Subject: Consultation Request from xxx website

Consultations are available Wednesday-Friday between 10-4pm, Saturdays 9-12, and Sunday by special appointment. Please enter the following information if you wish to make a consultation appointment, and we will be in touch as soon as we can.

Names: Bride and Groom Nicola Fleming

Wedding Date: 9/10/2010

Wedding Venue: wedding venue test

Mobile: 0408734533

Email: [email]nicola@xxx.com.au[/email]

Preferred Consultation Day: Thursday


How Did You Hear About Us: Word-of-Mouth



Verify: {imageverification}




Submitted by 60.228.224.147

Files:

1.Form passed first SPAM check OK
2.Form passed the submissions limit (if enabled) OK
3.Form passed the Image verification (if enabled) OK
4.Form passed the server side validation (if enabled) OK
5.$_POST Array: Array ( [names] => Nicola Fleming [weddingdate] => 9/10/2010 [venue] => wedding venue test [mobile] => 0408734533 [email] => [email]nicola@xxx.com.au[/email] [check0] => Array ( [0] => Thursday ) [hearabout] => Word-of-Mouth [chrono_verification] => DrYuA [button_11] => Submit [58ec0fadcfb75c4b64ef63ceb4bbbbbe] => 1 [1cf1] => 33266ad16d046634329d0202cb8ca875 [chronoformname] => consultation )
6.$_FILES Array: Array ( )
7.Form passed the plugins step (if enabled) OK
8.An email has been SENT successfully from (Admin - Wedding Flowers in Maleny)admin@xxx.com.au to [email]info@xxx.com.au[/email]
9.Debug End
10.Redirect link set, click to test:
http://www.xxx.com.au/index.php?option=com_content&view=article&id=116&Itemid=112
GreyHead 09 Oct, 2010
Hi Nicola,

Hmm . . . that does surprise me. I wonder if there is something else going on here too.

Please will you try one more test. Please go the Refraction Template configuration screen and set "Enable Input Styling" to 'No' (it's in the Paramters column at the right about level with the bottom of the Details box). Then try the form submission once more.

Bob
nicolaf 09 Oct, 2010
Hi Bob, this worked like a charm 🙂
With the input styling turned off in the Refraction configuration, the Preferred Consultation Day is passed through to the email correctly. Having the input styling turned off changed the style of the ticks in the checkboxes which is fine - do you know of anything else which will be effected?

Let me know if there is anything else I should do, or if leaving input styling off is a bad thing to do.
Many thanks for your help, I wouldn't have solved this alone.

Here is the data from debug submission:
Names: Bride and Groom Nicola Fleming

Wedding Date: 9/10/2010

Wedding Venue: wedding venue test

Mobile: 0408734533

Email: [email]nicola@xxx.com.au[/email]

Preferred Consultation Day: Thursday


How Did You Hear About Us: Word-of-Mouth



Verify: {imageverification}




Submitted by 60.228.224.147

Files:

1.Form passed first SPAM check OK
2.Form passed the submissions limit (if enabled) OK
3.Form passed the Image verification (if enabled) OK
4.Form passed the server side validation (if enabled) OK
5.$_POST Array: Array ( [names] => Nicola Fleming [weddingdate] => 9/10/2010 [venue] => wedding venue test [mobile] => 0408734533 [email] => [email]nicola@xxx.com.au[/email] [check0] => Array ( [0] => Thursday ) [hearabout] => Word-of-Mouth [chrono_verification] => r8u4F [button_11] => Submit [564527f890e572fbf6a74d28cc0e284e] => 1 [1cf1] => 33266ad16d046634329d0202cb8ca875 [chronoformname] => consultation )
6.$_FILES Array: Array ( )
7.Form passed the plugins step (if enabled) OK
8.An email has been SENT successfully from (Admin - )admin@xxxcom.au to [email]info@xxx.com.au[/email]
9.Debug End
10.Redirect link set, click to test:
http://www.xxx.com.au/index.php?option=com_content&view=article&id=116&Itemid=112
GreyHead 09 Oct, 2010
Hi Nicola,

Should be OK - the input styling will only affect the look of those ticks (and maybe some other form elements). Usually the checkboxes become un-tickable with input styling on.

I have no idea why they don't save correctly though :-( Added to the To-do list for a rainy day.

Bob
dminaH200 27 Oct, 2010
What placeholders do I use to get the checkbox data in email?

Like for the others I have used Name {Name} etc.

What do I used for checkbox? The label name? and what about the checkbox options?
GreyHead 27 Oct, 2010
Hi dminaH200 ,

Always the input name (not the label name) problaby {check0} unless you changed it.

Checkbox options will be displayed as values if there are any (and you have asked ChronoForms to handle the arrays).

Bob
This topic is locked and no more replies can be posted.