Forums

Question regarding Checkboxes

GroovyFish 25 Jun, 2009
I have a question regarding checkboxes, specifically, the email results.

Currently on a form I am working on, we have checkboxes with multiple choices, some very long (over a paragraph) in length, and the user could check one, or even all of them. When the results are emailed, each checkbox that a user has checked is received like this (example)

yellow, blue, red, green

What I would like is this:

yellow
blue
red
green

Because some of the choices are so long, with just a comma between the results, it all runs together. I attempted to change this myself, but was not sucessful. Could someone give me a hand with this?

Thanks!
Max_admin 26 Jun, 2009
Hi groovyfish,

Please tell me an example of a checkbox name in your form!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GroovyFish 26 Jun, 2009
Hi Max

One of the checkboxes' name is sitework

For this checkbox, there are two choices:

Proper grades and swales were not established before moved in
Settling of the ground around the foundation, utility trenches, or other areas

If a user were to select both options the email result would look like this:

Proper grades and swales were not established before moved in, Settling of the ground around the foundation, utility trenches, or other areas

That is not so bad for this particular checkbox because they are fairly short, but I have others that are much longer and that have many choices, of which they could choose all of them. So, when we receive the email, it's difficult to see exactly what they chose because it all runs together.

Thanks again!

I hope I am making sense.
Max_admin 28 Jun, 2009
Hi groovyfish,

ok, under the general tab change "Chronoforms handle my posted arrays" to no

use this code at the onsubmit before email box:


<?php
JRequest::setVar('sitework', implode("\n", $_POST['sitework']));
?>


Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GroovyFish 24 Jul, 2009
Max,

I apologize for taking so long to post this, but I wanted to thank you very much for this code. It worked perfectly!

Thanks again!

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