Get value of "Redirect to Page Based on Pulldown" field?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
deejmer
Forum Members
Forum Members
Posts: 69
Joined: Thu Jan 11, 2007 7:32 pm

Get value of "Redirect to Page Based on Pulldown" field?

Post by deejmer »

This is a similar issue to this post I found:  http://forum.cmsmadesimple.org/index.php?topic=33670.0.  The problem is, the solution does not work for me.

If I use the default template token, I either get the email address to which the form was routed, or the word "array" prints.  I would like to print in the email; which option was selected as shown in the dropdown field (not the resulting email address).

I'm using this syntax in the template per the post above, but nothing it returned: {$fld_99_obj->value}

Can someone help?    Thanks!
Peciura

Re: Get value of "Redirect to Page Based on Pulldown" field?

Post by Peciura »

Upload XML of the form so people would be able to import it on test site.
For me "array" sounds promising http://wiki.cmsmadesimple.org/index.php ... ode.2Fsite
User avatar
deejmer
Forum Members
Forum Members
Posts: 69
Joined: Thu Jan 11, 2007 7:32 pm

Re: Get value of "Redirect to Page Based on Pulldown" field?

Post by deejmer »

Attached is the XML of the form.....

Thanks!
Attachments

[The extension xml has been deactivated and can no longer be displayed.]

Peciura

Re: Get value of "Redirect to Page Based on Pulldown" field?

Post by Peciura »

Smth went wrong with XML there is no field names. ATM i am using my own naming. Can you write field names and ids by hand to forum (just to make things clear)?
You want to access email subject of corresponding address, don't you ?

EDIT:
OK. so i added field "*Call A User Defined Tag With the Form Results" and "Export form reference to UDT as $params['FORM']? " is on.
UDT you call in this field contains code
$search_field_id = '99'; /*field id "*Email Results Based on Pulldown" */
$session_variable = 'destination_subject'; /* session member to store subject */

$search_field_value = 'fld_'.$search_field_id;

foreach($params['FORM']->Fields as $key=>$one_field){
if (!empty($one_field->Name) && !empty($one_field->Id) && $one_field->Id==$search_field_id){
$field_number = $key;
break;
}
}

$email_key = array_search(${$search_field_value}, $params['FORM']->Fields[$field_number]->Options['destination_address']);
$_SESSION[$session_variable] = $params['FORM']->Fields[$field_number]->Options['destination_subject'][$email_key];
display value in emails and submission template
{$smarty.session.destination_subject}
EDIT: rewritten UDT so it is enough to supply id of field "*Email Results Based on Pulldown".
Last edited by Peciura on Fri Jul 30, 2010 5:21 pm, edited 1 time in total.
User avatar
deejmer
Forum Members
Forum Members
Posts: 69
Joined: Thu Jan 11, 2007 7:32 pm

Re: Get value of "Redirect to Page Based on Pulldown" field?

Post by deejmer »

Pecuria, thanks first off for helping me troubleshoot.  Its much appreciated.    Since the XML didn't work, I'm including two screenshots; one of the field options, and another showing the advanced tab for the email template.

Let me know if you need anything else.

Thanks!

(EDIT) on the template screenshot, i realized that the variable {$fld_99} was missing the closing bracket, but fixing it didn't get me any closer.  I still only get the value of the field as the email address to which the email is being routed; not the value as selected by the user in the dropdown.
Attachments
Email Destination - template.JPG
Email Destination - field.JPG
Last edited by deejmer on Fri Jul 30, 2010 3:52 pm, edited 1 time in total.
Peciura

Re: Get value of "Redirect to Page Based on Pulldown" field?

Post by Peciura »

Just rewritten UDT so it is enough to supply id of field "*Email Results Based on Pulldown".
User avatar
deejmer
Forum Members
Forum Members
Posts: 69
Joined: Thu Jan 11, 2007 7:32 pm

Re: Get value of "Redirect to Page Based on Pulldown" field?

Post by deejmer »

Awesome!  This looks nice.....Problem though, I dont see the option or indication:  "Export form reference to UDT as $params['FORM']? "

I'm running an older version of the form builder (0.4.4), so wonder if the option is there.  Where do you find it?  Maybe I need to update this module....
Peciura

Re: Get value of "Redirect to Page Based on Pulldown" field?

Post by Peciura »

It is FormBuilder 0.6.2. You have to upgrade.
Post Reply

Return to “Modules/Add-Ons”