Hi All,
I have a question. I'm using a form with a number of checkboxes. When I sent an email, the format in the email is "Extra's: {check1}". So far so good. The problem lies in the fact that the {check1} is displayed in the email separated by a comma.
So like this:
What I want is a sum up of all the items that were selected in the form when it was submitted. So what I want to do in the code is the replace the comma for a hard return like <br>.
So like this:
Does anybody know how to format the checked checkboxes?
Thanks in advance.
Greetz
Arkomat
I have a question. I'm using a form with a number of checkboxes. When I sent an email, the format in the email is "Extra's: {check1}". So far so good. The problem lies in the fact that the {check1} is displayed in the email separated by a comma.
So like this:
check1, check 2, check 3, check4 etc.
What I want is a sum up of all the items that were selected in the form when it was submitted. So what I want to do in the code is the replace the comma for a hard return like <br>.
So like this:
check1<br>check2<br>check3<br>check4<br> etc.
Does anybody know how to format the checked checkboxes?
Thanks in advance.
Greetz
Arkomat
Hi Arkomat,
This is a consequence of the ChronoForms array handling code that converts the checkbox array to a string. You need to re-work the conversion in the OnSubmit Before box. We'll change the name to 'check1a so that the original string value is still saved in the Database for future use.
Then use {check1a} in the email template.
Bob
This is a consequence of the ChronoForms array handling code that converts the checkbox array to a string. You need to re-work the conversion in the OnSubmit Before box. We'll change the name to 'check1a so that the original string value is still saved in the Database for future use.
<?php
$check1 = JRequest::getString('check1', '', 'post');
$check1 = str_replace(', ', '<br />', $check1);
JRequest::setVar('check1a', $check1);
?>Then use {check1a} in the email template.
Bob
This topic is locked and no more replies can be posted.
