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?

Adding a Label tag

More
10 years 2 weeks ago #1003 by jasons
Adding a Label tag was created by jasons
How can I add a label tag to each of my fields? I ran a section 508 test and was told that the fields did not have one. Is there a way to do this? Any held would be appreciated!

More
10 years 2 weeks ago - 10 years 2 weeks ago #1005 by Administrator AV
Replied by Administrator AV on topic Adding a Label tag
Hi Jason,

sorry but you have to change the code for that. This changes will be override with any Visforms update.

I think, at the moment, the easiest way would be to attach the label tags in the field definition in the visfield.xml in administrator/com_visforms/models/forms.

There is an xml-node
Code:
<fields name="defaultvalue">
and inside that a fieldset for each form field type supported by Visforms, with a name attribute which for example is visf_text, when the field type is text or visf_email when the field type is email.
Code:
<fieldset name="visf_text"

You can just add a new xml node inside each fieldset
Code:
<field name="f_text_attribute_label" type="text" label="COM_VISFORMS_INITIAL_VALUE" description="COM_VISFORMS_INITIAL_VALUE_DESC" class="inputbox" size="250" default="" />

You have to adapt the name attribute according to the field type. So it would be f_email_attribute_label for an email field and so on.
Replace the language tags (like COM_VISFORMS_INITIAL_VALUE) in label and description attribute with texts that makes sense to you.

I would start with changing the xml definition of one Visforms field type first.

After you added the code above you should see a new input in the fields edit view for that field type in your Joomla! administration. Insert the label text you want to attach to the control there. It will be passed directly on to the field construction in the form and be added as label attribute using the value you inserted in the field edit view.

This should work for most field types. But I think it will not work for the items of selects and radios.

I have not tested it, but it is consistant with the way Visforms works and therefore should work.

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 :-).
Last edit: 10 years 2 weeks ago by Administrator AV.

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum