Forums

How to not display UnCheckBox in email

le0n831 03 Apr, 2009
I created a form and it works, but I'm having a problem with the checkbox. If a user doesn't select a checkbox it displays the options/checkbox name in the email and I don't want that to happen. I only want the email to contain options or checkboxes that the user selected. What will be the instructions or code to make this happen
GreyHead 03 Apr, 2009
Hi le0n831,

You'll need to add some PHP in the email template to check the values of the fields and display or hide them depending on the values.

Bob
le0n831 06 Apr, 2009
Hi GreyHead,

In the Email Template, would I have to click on the "Edit HTML Source" button then add the php code, or can I simply place the code on.

Sample from Email Template:
Contact Information
Organization Name {text_2}
Purpose of Organization {text_3}

so do I place the php code like this:

Contact Information
<?php
if (!isnull($text_2)) {
echo "Organization Name $text_2"
}
?>

...(Iterate)
GreyHead 07 Apr, 2009
Hi le0n831,

I think that you have to turn the HTML editor off in order to add PHP. The switch is 'Use Template Editor' in the Email Setup Properties.

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