Email text from dropdown list instead of value?

jk jkerr 09 Feb, 2011
Hi all

Due to character limitations, I need to name the values for my drop down options as 101, 102 etc. When I receive the form in my email, it shows these values. Is there a way to get it to send the text that these values represent?

Cheers
Jamie
Gr GreyHead 09 Feb, 2011
Hi Jamie,

In the OnSubmit Before Email code box you can add a little PHP to look up the values.
<?php
$v_array = array(
  '101' => '7 inch pliers', 
  '102' => 'Wire cutters', 
  . . .
);
$tool = JRequest::getString('tool', 0, 'post');
$tool_name = $v_array[$tool];
JRequest::setVar('tool_name', $tool_name);
?>

Then use {tool_name} in the Email template.

Bob
jk jkerr 09 Feb, 2011
Thanks a lot man. You are a genius!
This topic is locked and no more replies can be posted.