Joomla 5 Notice

We are pleased to announce that as of January 29, 2024, all of our Joomla extensions are compatible with Joomla 5.

For all who are still updateing from Joomla 3 to Joomla 4: Joomla 4 Migration instructions are available here:

There is now a separate Documentation for Visforms for Joomla 4 and for Visforms for Joomla 5!

Forum

Visforms Subscription user can ask questions in our forum. Please log in with the relevant user first.
Everybody can access the forum for reading.

Please only ask 1 question per topic.

value of selection type not returned

More
6 years 8 months ago #4598 by cverger
value of selection type not returned was created by cverger
On the result page I want to see data types in the form by the user. For example, If I have item Name and email, with the types text and email,it workds. I just put visformfield [name]

More
6 years 8 months ago #4600 by Administrator AV
Replied by Administrator AV on topic value of selection type not returned
Hi,

fields of type select, radio and checkboxgroup have options which consist of a label and a value each. If user inputs for this fields are stored in the data base, the selected value is stored. If user inputs for this fields are used somewhere inside Visforms (in a calculation, in conditional fields, as ulr parameters in a redirect url....) always the selected value is used or passed.

But if user inputs for those fields are displayed for the user to see (data view, emails, result message) the label of the selected option is displayed, because this is what the user see when they make the selection and there is, what they expect to see. This allows you to use different "strings" for the label and the value and consistantly display/use the expected one.

There is no way to change this behavior. So the only solution would be to use the same "string" as label and value.

Regards,
Aicha

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

More
6 years 8 months ago #4601 by cverger
Replied by cverger on topic value of selection type not returned
Thank you for your reply, but unfortunately it did not solve my problem. May be I will explain more in detail : I want in the select type fleld that the visitor select the short name of powerpoint file and that he gets in the reply page the URL to download this file. So I put the name in the label and the URL in the value (which is not seen at first by the visitor). Of course if I put the URL as label it works but it makes the label poorly understandable. I set up a reply mail with the content of the form and this is a solution as it works with it but the problem is the reply mail can be blocked by antispam, so I would prefer the value returned in a page. I hope I am clear.
Many thankd in advance if you can help me.
Christian

More
6 years 8 months ago #4602 by Administrator AV
Replied by Administrator AV on topic value of selection type not returned
Hi,

the only solution I can see at the moment would be a modification in a Visforms Core file.

I think that if you make the following modifications to the file administrator\components\com_visforms\helpers\html\visforms.php this would work but I have not tested (Please make a backup copy of the original file first in case the modification does not work.) and you will loose these changes with any Visforms update (and have to add them manually after the update again.)

In the public static function replacePlaceholder($form, &$text = '') you find the following code at about line 729
Code:
if (in_array($fieldtype, array("multicheckbox", "select", "radio"))) { $fieldValue = implode(', ', JHtmlVisformsselect::mapDbValueToOptionLabel($fieldValue, $ffield->list_hidden)); }

replace it with
Code:
if (in_array($fieldtype, array("multicheckbox", "select", "radio"))) { $fieldValue = JHtmlVisformsselect::removeNullbyte($ffield->dbValue); }

Regards,
Aicha

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

More
6 years 8 months ago #4604 by cverger
Replied by cverger on topic value of selection type not returned
Thank you thousand of times : your reply was fast and your solution works perfectly.

More
6 years 8 months ago #4605 by Administrator AV
Replied by Administrator AV on topic value of selection type not returned
Hi,

I'll make it a feature in Visforms.

I'll add a new configuration parameter to the fields of type select, radio and multi checkbox, which will allow you to choose, if placeholders of the field (as the can be used in the email texts and the form result message text) are replaced with the option label (which is the default, because that is the way it is done now) or with the option value. T

his feature will be released with the next Visforms version. So if you update Visforms, then, you just have to set this field configuration option instead of changing the code in the Visforms core file again.

Regards,
Aicha

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum