Dynamic To and Dropdown

tshirley 28 Apr, 2013
Hi,

I am having trouble getting a simple dropdown with a "value=label" list to deliver an email address to the Dynamic To recipient field.

For example I have a dropdown "input_dept" with value-labels such as:

[email]dept1@mydomain.com[/email]=Dept 1
[email]dept2@mydomain.com[/email]=Dept 2
...

And I expected when I put input_dept in the Dynamic To field that it would send the email to the selected email address. The form works with a static To address.

The debugger output for the form looks like this:

Data Array:
Array
(
[option] => com_chronoforms
[tmpl] => component
[chronoform] => Contact_us_form
[event] => submit
[Itemid] =>
[input_dept] => Array
(
[0] => [email]dept1@mydomain.com[/email]
)

[input_name] => Tim
[input_gfa_nbr] => E64
[input_email] => [email]sender@internode.on.net[/email]
[input_comment] => test Comment
[input_submit_8] => Submit
[908a03a88b54fdc86b8545ab9bf48937] => 1
)
Validation Errors:
Array
(
)
Thank you for your comment or query. An email has been sent to the appropriate GFA Department and will be attended to as soon as possible.

Debug Data
email
0
Result
An email has been SENT successfully from (Admin)admin@mydomain.com to Array
Body
Message From: Tim GFA Nbr: E64 test Comment Sent To: array ( 0 => [email]'dept1@mydomain.com[/email]', )



Submitted by 118.209.85.219
Attachments
array ( )
Powered By ChronoForms - ChronoEngine.com

So... it seems the output from the dropdown includes the text "array ( 0 =>", and so does not provide a valid email address?

I know I'm doing something wrong, I just can't see it.

Cheers

Tim
GreyHead 28 Apr, 2013
Hi tshirley,

It looks as though your drop-down is returning an array of values, not just one. This will give the standard email action indigestion. If you get my Email [GH] action that should handle an array OK.

If you only need a single address selected then you should either deselect the Multiple checkbox in the element, or remove the [] from the name if you have hand-coded the HTML.

In general we don't recommend showing email addresses in any publicy visible form. There is a FAQ about handling this here.

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