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?

Some issue with selectsql type of field

More
1 year 5 months ago #9372 by liaskas
Hello
in a form i have created in the past (and was working like a charm), now i have the following problem...

I use a field of type selectsql.

This field gets some values fro the database and lists them to the user that fill the form to select.
The SQL statement used is...
SELECT DISTINCT a.username AS label, a.id, b.fromuser, b.touser AS value FROM #__users a left join #__jchat b on b.fromuser = a.id WHERE b.touser='${user:id}' ORDER BY label ASC;

and it gives no errors. Right now test says "success: found 4 entries"

At the front end i see correctly the 4 different values.

Now when i select one of the values of the selectsql field, i always get "Please select no more than 1 option(s) for field xxx" when submitting the form.

Can you please advise how to solve this problem?

More
1 year 5 months ago #9374 by Administrator IV
Replied by Administrator IV on topic Some issue with selectsql type of field
Hello liaskas,

my advice for fixing the incorrectly filled form is to make sure the sql listbox has all option values unique.

I suspect that it is not due to the Visforms field configuration.
I also suspect that your SQL statement produces, at least in part, identical values in the options values.
So it's up to the data or the SQL statement.

Here is a small example.
The error occurs when you select the ''label-1-a' or ''label-1-a' options.
The error does not occur when you select the ''label-3' or ''label-4' options.

select 'label-1-a' as label, 'value-1' as value
union select 'label-1-b' as label, 'value-1' as value
union select 'label-3' as label, 'value-3' as value
union select 'label-4' as label, 'value-4' as value;

Kind regards, Ingmar

: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