Forums

multiple check boxes not showing up in emails

goforthclan 23 Jan, 2009
i have read the other posts on this topic and quite frankly i don' understand the answers any help would be greatly appreciated.

this is the problem i have a section in my form that has 10 check boxes here is the code from the form:
class="form_element cf_checkbox"><label class="cf_label"></label><div class="float_left"><input value="HIV/AIDS" class="radio validate-one-required" id="HIV/AIDS" name="HIV/AIDS" type="checkbox"><label for="HIV/AIDS" class="check_label">HIV/AIDS</label><br><input value="Diabetes" class="radio" id="Diabetes" name="Diabetes" type="checkbox"><label for="Diabetes" class="check_label">Diabetes</label><br><input value="Cancer" class="radio" id="Cancer" name="Cancer" type="checkbox"><label for="Cancer" class="check_label">Cancer</label><br><input value="Heart Attack" class="radio" id="Heart_Attack" name="Heart_Attack" type="checkbox"><label for="Heart_Attack" class="check_label">Heart Attack</label><br><input value="High Blood Pressure" class="radio" id="High_Blood Pressure" name="High_Blood Pressure" type="checkbox"><label for="High_Blood Pressure" class="check_label">High Blood Pressure</label><br><input value="Asthma" class="radio" id="Asthma" name="Asthma" type="checkbox"><label for="Asthma" class="check_label">Asthma</label><br><input value="Stroke"
 class="radio" id="Stroke" name="Stroke" type="checkbox"><label for="Stroke" class="check_label">Stroke</label><br><input value="Depression Requiring Medication" class="radio" id="Depression_Requiring Medication" name="Depression_Requiring Medication" type="checkbox"><label for="Depression_Requiring Medication" class="check_label">Depression Requiring Medication</label><br><input value="Other Major Illness" class="radio" id="Other_Major Illness" name="Other_Major Illness" type="checkbox"><label for="Other_Major Illness" class="check_label">Other Major Illness</label><br><input value="None
"
 class="radio" id="None
"
 name="None
" type="checkbox"><label for="None
"
 class="check_label">None
</label><br></div></div>


if multiple check boxes are checked the first one only shows up in the email here is the email template for the check box area:
Have you been diagnosed with any of the following conditions? Please check all that apply. If none, please check none.
{HIV/AIDS}: HIV/AIDS
{Diabetes}: Diabetes
{Cancer}: Cancer
{Heart_Attack}: Heart Attack
{High_Blood Pressure}: High Blood Pressure
{Asthma}: Asthma
{Stroke}: Stroke
{Depression_Requiring Medication}: Depression Requiring Medication
{Other_Major Illness}: Other Major Illness
{None}: None 


what i would like is for the email to show all choices that have been checked.
i am just learning how to edit and need the answer broken down in it's most simple form
thanks
Max_admin 23 Jan, 2009
Hi goforthclan,

you will need to edit the form code alittle, you have 10 checkboxes, each one of them has name="something" e.g: name="Diabetes", change the code of them all so that all of them have
name="disease[]"
then change your email template code to be :
Diseases list : {disease}


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
goforthclan 24 Jan, 2009
Ok i think i did as you insturcted here is how i changed the form code:

</div><div  class="form_item"><div class="form_element cf_checkbox"><label class="cf_label"></label><div class="float_left"><input value="HIV/AIDS" class="radio validate-one-required" id="HIV/AIDS" name="Medical_Condition" type="checkbox"><label for="HIV/AIDS" class="check_label">HIV/AIDS</label><br><input value="Diabetes" class="radio" id="Diabetes" name="Medical_Condition" type="checkbox"><label for="Diabetes" class="check_label">Diabetes</label><br><input value="Cancer" class="radio" id="Cancer" name="Medical_Condition" type="checkbox"><label for="Cancer" class="check_label">Cancer</label><br><input value="Heart Attack" class="radio" id="Heart_Attack" name="Medical_Condition" type="checkbox"><label for="Heart_Attack" class="check_label">Heart Attack</label><br><input value="High Blood Pressure" class="radio" id="High_Blood Pressure" name="Medical_Condition" type="checkbox"><label for="High_Blood Pressure" class="check_label">High Blood Pressure</label><br><input value="Asthma" class="radio" id="Asthma" name="Medical_Condition" type="checkbox"><label for="Asthma" class="check_label">Asthma</label><br><input value="Stroke"
 class="radio" id="Stroke" name="Medical_Condition" type="checkbox"><label for="Stroke" class="check_label">Stroke</label><br><input value="Depression Requiring Medication" class="radio" id="Depression_Requiring Medication" name="Medical_Condition" type="checkbox"><label for="Depression_Requiring Medication" class="check_label">Depression Requiring Medication</label><br><input value="Other Major Illness" class="radio" id="Other_Major Illness" name="Medical_Condition" type="checkbox"><label for="Other_Major Illness" class="check_label">Other Major Illness</label><br><input value="None
"
 class="radio" id="None
"
 name="Medical_Condition;" type="checkbox"><label for="None
"
 class="check_label">None
</label><br></div></div>


here is how i changed the email template:

Have you been diagnosed with any of the following conditions? Please check all that apply. If none, please check none.
Conditions : {Medical_Condition}


it did clean up the template however on my test i checked 3 conditions - Diabetes, High Blood Pressure and Depression Requiring Medication

here is how the email looked when i received the form:

Have you been diagnosed with any of the following conditions? Please check all that apply. If none, please check none.
Conditions : Depression Requiring Medication


As you can see the only response put into the email was the last one checked which was depression requiring medication.
Making Progress but not quite there any other suggestions?
btw: when creating the form in the form wizard i did check the box for validation that one selection must be made. even if it is none.
goforthclan 24 Jan, 2009
i read this post:
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&p=14216#p14216

and with the help you gave me earlier admin and the post information by greyhead i got it to work after reading the post i went through the code and put [] behind each name="Medical_Condition" making them name="Medical_Condition[]"
I also found a stray ; in the last choice field name i don't know which did it removing the stray ; or putting in the [] but it works the email now shows the following with the same choices above checked:

Conditions : Diabetes, High Blood Pressure, Depression Requiring Medication

Yeeeaaah this forum is awesome! thank you
GreyHead 24 Jan, 2009
Hi goforthclan,

Excellent, I was just about to try and work my way through your code here. Sorry it didn't get done earlier but it isn't a 'one minute' reply.

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