field dropdown

ernst@volny.cz 29 Apr, 2016
In form I have field type dropdown with multiselect.
if I give this field to email, only the last choice, not all

eg. {dropdown14} show only last selection


Thank you in advance for your advice
GreyHead 30 Apr, 2016
1 Likes
Hi ernst,

Please change the name to an array name with [] at the end e.g. dropdown14[]

And please drag a Handle Arrays action into the OnSubmit event and move it up before any Email or DB Save actions.

Bob

PS I recommend that you do not use your email address as a username here as it is publicly visible and may be scraped and spammed. If you PM me I can change that for you.
ernst@volny.cz 30 Apr, 2016
And I have one more question?
How can I get myself after sending the form back to the page that was called ?.
I use a redirect, but I do not know how?
GreyHead 30 Apr, 2016
Hi ernst,

You can use an Event Loop action as the last action in the form On Submit event. That will reload the form - you may find that existing values are re-loaded, if you don't want that to happen you can unset them before the Event Loop.

Bob
ernst@volny.cz 30 Apr, 2016
I guess I was badly expressed
I do not need to get back to the form but to the page from which the form was called.
GreyHead 30 Apr, 2016
Hi ernst,

Please see this FAQ you can then redirect to the saved URL.

Bob
ernst@volny.cz 30 Apr, 2016
That is a good idea.
I get the variable value of the url and it can using php function (strpos, substr etc.) changed.
But as, after submitting the form to call this URL?
Redirect does not support {page_url}
GreyHead 01 May, 2016
Hi Ernst,

There ia a way to over-write the URL In the ReDirect but it's a bit techie. The simplest solution is to use the Joomla! redirection code in a Custom Code action:
<?php
$app = \JFactory::getApplication();
// $app->enqueueMessage('Some message here'); // Use this to show a system message
$app->redirect($form->data['page_url']);
?>

If you need to remove the $form->data[''] first:
<?php
$app = \JFactory::getApplication();
// $app->enqueueMessage('Some message here'); // Use this to show a system message
$url = $form->data['page_url'];
unset($form->data);
$app->redirect($url);
?>
!! Not tested and may need debugging !!

Bob
ernst@volny.cz 07 May, 2016
So I finally got to test and resolve this problem.
To summarize, I needed after sends the form to return to the page from which the form was called.

1. In ChronoForms the designer to specify custom fields with the following content:
<input type='hidden' name='page_url' id='page_url' value='<?php echo JFactory::getApplication()->input->server->get('HTTP_REFERER', '', 'raw'); ?>' />

Leave the field without a label, it will not appear at all.

2 to email, you can add information to a form where it was called, for example,
<tr><td>Mám zájem o:</td><td>{dropdown15}</td></tr>
<tr><td>Bližší popis požadavku:</td><td>{textarea16}</td></tr>
<tr><td>Odesláno z adresy:</td><td>{page_url}</td></tr>
</table>


3. Forwarding can not use the redirect, but after sending emails or other events can finally insert custom fields with the following content:
<?php
$app = \JFactory::getApplication();
$url = $form->data['page_url'];
unset($form->data);
$app->redirect($url);
?>


It might be worth incorporating this solution directly into future versions ChronoForms.
This topic is locked and no more replies can be posted.