I have a select component in a web form. Four options, mandatory and the choose multiple values option. I have the web form email themed like so . . .
<strong>brand contacting about:</strong><font face="Arial, Helvetica, sans-serif" size="2"><?php echo $form_values['submitted_tree']['brand'] ?></font>
When the email submission comes through it just has ... brand contacting about:Array

What do I need to do to get the choices to show up. I'm missing somthing there and I'm guessing I need to theme it differently.
Thanks.

Comments

quicksketch’s picture

Yes, because if you can select multiple values then the data is an array instead of a string.

if (is_array($form_values['submitted_tree']['brand'])) {
  foreach ($form_values['submitted_tree']['brand'] as $value) {
    print $value;
  }
}
else {
  print $form_values['submitted_tree']['brand'];
}

This example has more code than you'd need, but it might be helpful because it would work if you disabled the "multiple" option later.

fuquam’s picture

Status: Active » Closed (fixed)

Duh. Thank you. I should have figured that one out. I swear I searched for the answer first. Thanks for the quick reply.