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?

Pre Populating Dropdown Lists Automatically

More
9 years 2 weeks ago #2187 by Thinamani
Hi There,

I have created a server build request form using VisForms. In the form fields the requester enters details about the server and what is is used for and who the owner is. I have a particular text field to enter the Business Unit of which the server belongs to or is requested by. I would like to make the text field into a drop down list and automatically pre populate the drop down list with a list of business units from a text file. Currently the only way to populate the dropdown list is to manually enter the list items within the Admin Form Fields edit screen.

Is there a way for me to possibly re code it to look into a text file and pre populate it from the front end?

Thank you
Pavetiran Thinamani

More
9 years 2 weeks ago #2189 by Administrator AV
Replied by Administrator AV on topic Pre Populating Dropdown Lists Automatically
Hi Pavetiran,

at the moment Visforms expects the drop down list options to be created in the Admin Form Fields edit screen. The business logic of managing drop down fields in the code is quite complex and the code relies on this assumption.
- There is code that prevents you from creating and storing a field of type select without options in the Admin Form
- There is code that checks that a submitted value for a field of type select is a valid option (of the option list stored for this field) to prevent data tempering.
- ...
So, although it would not be too difficult to add options to a select field dynamically (using a text file) re coding Visforms to work with it, is not so easy (and in my opinion not possible with advanced knowledge of the Visforms code and of php coding) and can break Visforms easily.
I'm sorry. I never thought about this possibility and designed the code the way it is (focusing on security).
But this is an interesting feature and I will take it into account for further development in the future.

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