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.

Conditional field only working 2nd time

More
8 years 9 months ago #1918 by guuske
Hi,
I'm building a new website with a form in Joomla 3.4.3 and Visforms 3.4.3. In my form I have a conditional field, but the field which should be visible after selecting a specific option, is only visible after selecting the specific radio button for the 2nd time. So, the first time that the option is selected, nothing happens.

Does anyone have an idea what could be wrong?
Thanks, Guus.

More
8 years 9 months ago #1920 by Administrator AV
Replied by Administrator AV on topic Conditional field only working 2nd time
Hi,

as you are the second person who describes this problem I think this is a bug in Visforms.
But I have some difficulties reproducing the bug and therefore fixing it.

You could help me, if you could make a export of the #__visforms and #_visfields table in your database into an .sql file and mail this file to me (contact@vi-solutions.de). I would also need to know how you display the form (using a menu item or a module...). I think this would make it easier to reproduce the problem and investigate it further in the debugger.

Thanks and 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
8 years 9 months ago #1923 by Administrator AV
Replied by Administrator AV on topic Conditional field only working 2nd time
Hi Guus,

thanks for sending me the files and for your quick response which enabled me to reproduce the problem and I think already find a solution.

For some reason, which I still have to track down, a piece of code, which is not as properly written as it should be, has become more important than in previous Visforms Versions and this piece of code causes the problem. I think the problem occurs at least in Visforms 3.4 and 3.5 Versions.

I will fix the problem in the next Visforms release but for everybody who runs into the same problem before the release is available, here a description how to fix it. I will pass the exact same code changes to Visforms.

Please open the file components/com_visforms/lib/business.php

Find the
Code:
protected function addShowWhenForForm ()
which starts at line 303

Find
Code:
$field->showWhenForForm = $showWhenForForm;
almost at the bottom of this function at line 358 and replace it with
Code:
if (!empty($showWhenForForm)) { $field->showWhenForForm = $showWhenForForm; }

I tested with your data and it fixed the problem.

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
8 years 9 months ago #1925 by guuske
Replied by guuske on topic Conditional field only working 2nd time
Wow! Great support, it solved the problem!

Thanks Aicha.

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum