This is the part of the Form, where I have 3 checkboxes
Here is the part in the email template
I don't get any results, why??
<table>
<p><tr><td>
<input type="checkbox" name="check0" value=" I plan to attend the conference" size="5"> I plan to attend the conference<p><tr><td>
<input type="checkbox" name="check1" value=" I plan to participate and submit a paper" size="5"> I plan to participate and submit a paper
<p><tr><td>
<input type="checkbox" name="check2" value="Please send me further info on the conference" size="5"> Please send me further info on the conference Here is the part in the email template
{check0} I plan to attend the conference
{check1} I plan to participate and submit a paper
{check2} Please send me further info on the conference
I don't get any results, why??
Hi finc,
You probably just need
Bob
You probably just need
{check0}
{check1}
{check2}in your template - the labels just repeat the values.Bob
Yeah thats it:
Adding this to the Email Template
{C1}
{C2}
{C3}
{C4}
I get unchecked results shown as checkbox name??
This 1st one is checked text
{C2}
{C3}
This 4th one is checked text
Adding this to the Email Template
{C1}
{C2}
{C3}
{C4}
I get unchecked results shown as checkbox name??
This 1st one is checked text
{C2}
{C3}
This 4th one is checked text
Hi finc,
Yes, much discussed here and the code to hide them has been posted a couple of times.
In this case I suggest that you create a checkbox array by using the same array name='check0[]' for each input and putting {check0} in the Tempalte - that way you will only have the problem if they leave all the chackboxes un-checked.
Bob
PS You wil also need to set 'Let ChronoForms handle arrays' to 'Yes' on the form General tab.
Yes, much discussed here and the code to hide them has been posted a couple of times.
In this case I suggest that you create a checkbox array by using the same array name='check0[]' for each input and putting {check0} in the Tempalte - that way you will only have the problem if they leave all the chackboxes un-checked.
Bob
PS You wil also need to set 'Let ChronoForms handle arrays' to 'Yes' on the form General tab.
Okay doing that results anyway in one row😟
check0[1]
check0[2]
check0[3]
check0[4]
Results
{check0}
comes in one row
checked box 1 text , checked box 2 text
check0[1]
check0[2]
check0[3]
check0[4]
Results
{check0}
comes in one row
checked box 1 text , checked box 2 text
Hi finc,
Because they've been switched from an array into a string. You can manage the array handling yourself and switch it to use <br /> if you prefer.
Bob
Because they've been switched from an array into a string. You can manage the array handling yourself and switch it to use <br /> if you prefer.
Bob
That means I do not let chronoforms handle arrays.
After that how I do it?
{check0}</br> ???
After that how I do it?
{check0}</br> ???
Hi finc,
Try this in the OnSubmit Before Box:
Bob
Later: removed a stray ' from line 2
Try this in the OnSubmit Before Box:
<?php
$check0 = JRequest::getVar('check0', array(), 'post', 'array');
$check0 = implode('<br />', $check0);
JRequest::setVar('check0', $check0);
?> Bob
Later: removed a stray ' from line 2
took chronoform handles arrays to OFF
pasted Your code into "On Submit code - before sending email:" Box
got this after submit
pasted Your code into "On Submit code - before sending email:" Box
got this after submit
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in public_html/components/com_chronocontact/libraries/customcode.php(64) : eval()'d code on line 2
Hi finc,
Apologies, there's a stray ' in this line
I'll update my first post.
Bob
Apologies, there's a stray ' in this line
$check0 = JRequest::getVar('check0', array()', 'post', 'array');should be$check0 = JRequest::getVar('check0', array(), 'post', 'array');I'll update my first post.
Bob
This topic is locked and no more replies can be posted.
