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?

Json error on select contrôl

More
7 years 9 months ago - 7 years 9 months ago #4033 by tarek
Json error on select contrôl was created by tarek
Hi,

Thanks to your viforms component, it's working well, only one problème when setting a select with values containing special characters like thos options:
  • >100€ et <200€ with same label
  • >200€ et <500€

I got errors this error after saving
Code:
Uncaught SyntaxError: Unexpected token : in JSON at position 64 at JSON.parse (<anonymous>) at createItemsObjFromString (itemlistcreator.js:88)
Last edit: 7 years 9 months ago by tarek.

More
7 years 9 months ago #4034 by Administrator AV
Replied by Administrator AV on topic Json error on select contrôl
Hi,

thanks for your post.
I'll check into this.

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
7 years 9 months ago #4038 by Administrator AV
Replied by Administrator AV on topic Json error on select contrôl
Hi,

I did some research on this and I was wondering, which Visforms version you are using.

In the current Version 3.8.16, errors from the createItemsObjFromString function are caught in the javascript, so that you would get an more readable error message when you press the "save" button in the form where you edit the select option.

Nevertheless I found out, that obviously the JSON.stringify function used by my browser, does not throw this error at all. So what browser do you use?

Further on, if i try to store the field to the database (Save button in the task line), I get an php error. In order to get rid of this php error I have to modify the visfield.xml file in administrator/components/com_visforms/models/forms.

There is a
Code:
<field name="f_radio_list_hidden" type="itemlistcreator" id="f_radio_list_hidden" default="" label="COM_VISFORMS_CHECKBOX_LIST" description="COM_VISFORMS_RADIO_LIST_DESC" />
at line 570
which has to be changed into
Code:
<field name="f_radio_list_hidden" type="itemlistcreator" id="f_radio_list_hidden" default="" label="COM_VISFORMS_CHECKBOX_LIST" description="COM_VISFORMS_RADIO_LIST_DESC" filter="raw" />
So you have to add the filter="raw"
The same with
Code:
<field name="f_select_list_hidden" type="itemlistcreator" id="f_select_list_hidden" label="COM_VISFORMS_CHECKBOX_LIST" description="COM_VISFORMS_LISTBOX_LIST_DESC" default="" filter="raw" />
alt line 608 and with
Code:
<field name="f_multicheckbox_list_hidden" type="itemlistcreator" id="f_multicheckbox_list_hidden" default="" label="COM_VISFORMS_CHECKBOX_LIST" description="COM_VISFORMS_CHECKBOX_LIST_DESC" filter="raw" />
at line 652

These changes will be merged into the next Visforms Version, but the Javascript error which you get and which I cannot reproduce, still needs fixing. Hopefully I can do that, when I get more information from you.

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