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.

Important information for almost every question:
V1: Which Visforms version is running?
V2: Which Joomla version is running?
V3: Which PHP version is running?

Dynamic value for select field type

More
9 years 9 months ago #1335 by yvesvo
Dynamic value for select field type was created by yvesvo
Hi,
First of ... I like your component (viForms) a lot ...
Then for my question/problem:
In a previous version of the component I made a "dynamic select" where the data for the options from the select were dynamically generated based on values in a table somewhere ...
this was done by adding a fixed option and replacing part of that option with the other options ... let me elaborate ;-)
the option that was entered looked like this : {MORE}||somevaluethatisallwaysthere
in this option some code changed the value of {MORE} into Option1||Option1 ; Option2||Option2 ; somevaluethatisallwaysthere (this was done in the HTML so it is a bit more complex than is shown here ... all the right code parts were added as well)
that way the form was correct and it worked ...
until I did an update of the viForms component a short while back ... all of a sudden the form could not be validated. I guess because the value that was chosen is not a value that was entered as an original value ...

Is there a way to get this working again ? (by either disabling this check or by being able to create a dynamical list from an SQL or something like that)

More
9 years 9 months ago #1338 by Administrator AV
Replied by Administrator AV on topic Dynamic value for select field type
Hi,

hu. The format and the creation of selects has changed fundamentally in Visforms 3.2.0.
So you are no longer able of creating a "dummy" option like "{MORE}, because I already check in the field configuration, that each option has a label and a value.

But I also included an event system that allows you to create custom plugins for Visforms. There is an Event onVisformsBeforeHtmlPrepare(com_visforms.field', &$field, $layout) and an event onVisformsAfterHtmlPrepare(com_visforms.field', &$field, &$html, $layout) which you might use to implement you custom code. (Plugin group is "visforms").

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 :-).
The following user(s) said Thank You: yvesvo

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum