Joomla 5 Mitteilung

Wir freuen uns mitteilen zu können, dass seit dem 29. Januar 2024 alle unsere Joomla Erweiterungen mit Joomla 5 kompatible sind.

Für alle die gerade noch von Joomla 3 auf 4 aktualisieren: Anleitungen für die Joomla 4 Migration gibt es hier:

Es gibt nun auch eine eigenständige Dokumentation für Visforms für Joomla 4 und für Visforms auf Joomla 5

Forum

Visforms Subscription Inhaber können in unserem Forum Fragen stellen. Bitte mit dem entsprechenden Benutzer anmelden.
Jeder kann lesend auf das Forum zugreifen.

Bitte stellen Sie nur 1 Frage pro Thema.

Wichtig Angaben für fast jede Frage:
V1: Welche Visforms-Version läuft?
V2: Welche Joomla-Version läuft?
V3: Welche PHP-Version läuft?

Aufgrund von Feiertagen und Urlaub ist bei Anfragen im Forum in der Zeit vom 20. Dezember 2024 bis zum 8.Januar 2025 mit verlängerten Antwortzeiten zu rechnen.

Field title displayed in the field box

Mehr
10 Jahre 1 Monat her #1016 von rickshadey
Field title displayed in the field box wurde erstellt von rickshadey
Any help with this issue?
I want to do this in order to decrease the height of the form. Any suggestions?

Mehr
10 Jahre 1 Monat her #1019 von Administrator AV
Administrator AV antwortete auf Field title displayed in the field box
Hi rickshadey,

this is only possible with a bundle code changes which would require a bit of knowledge about the Joomla! framework especially the JForms part of it.
You would have to extend the field definition in the fields.xml file and adapt the view files.
If you are up to this I could describe the steps for you in principle.

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 :-).

Mehr
10 Jahre 1 Monat her #1029 von rickshadey
rickshadey antwortete auf Field title displayed in the field box
I consider myself moderately capable at Joomla,PHP,HTML tweaking. And I do like a challenge to learn something new. If you have the time, I'd love to see what you have to say. Thanks!

Mehr
10 Jahre 1 Monat her #1032 von Administrator AV
Administrator AV antwortete auf Field title displayed in the field box
OK, I will check into this next week.

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 :-).

Mehr
10 Jahre 1 Monat her #1037 von Administrator AV
Administrator AV antwortete auf Field title displayed in the field box
Hi rickshadey,

sorry, that you had to wait some days, but I actually implemented the feature for Visforms 3.2.0 for Joomla! 3.x (which will be released soon as a beta) and tested it and that took some time.

The plan is, to add an option "show label" and an HTML attribute "placeholder" to all text inputs (input with type text, date, url, email, number or password).

When an HTML text input Element has a placeholder attribute the value of that attribute is displayed inside the input. The placeholder attribute is supported widely and it is possible to add support for browsers, which do not support the feature by themselfs, using javascript. When the user clicks inside the input the placeholder text vanishes (in some Browsers you have actually to start to enter some characters).

The good thing is, that if you are on Joomla! 3 (as I assume) and you implement the feature by following my instructions, it will still work, when you update to a newer Visforms version in the future.

So here's my answer.

1) Add two new parameters to the field definition (administrator/components/com_visforms/models/forms/visfield.xml) for each "text" field (text, date, url, email, number and password).
You'll find a fieldset for each fieldtype. It's name is visf_text for the input type=text, visf_date for the input type=date ... (so you have to make changes in six fieldsets).
For each of the six fieldsets, insert the following code as first xml-elements inside the fieldset (after the opening fieldset xml-tag).
administrator/components/com_visforms/models/forms/visfield.xml
Code:
<field name="f_text_show_label" type="list" label="COM_VISFORMS_SHOW_LABEL" description="COM_VISFORMS_SHOW_LABEL_DESC" class="inputbox" default="0"> <option value="0">COM_VISFORMS_SHOW_LABEL_SHOW</option> <option value="1">COM_VISFORMS_SHOW_LABEL_HIDE</option> </field> <field name="f_text_attribute_placeholder" type="text" label="COM_VISFORMS_PLACEHOLDER_VALUE" description="COM_VISFORMS_PLACEHOLDER_VALUE_DESC" class="inputbox" size="50" default="" />

Change the "_text_" in the name attribute according to the input type (to "_date_" etc.)
Add the language Tags to the componentadministration language files (administrator/componenten/com_visforms/language...) and translate them.

2) Go to the administration of your website. You have to open each "text" field, for which you want to hide the label. You should see the two new parameters there. Hide the label, insert a placeholder and save your changes.

3) Hide Labels in form HTML
You have to make changes to the default.php of the view. If you have attached your form to a menu item of type visforms you have to change the default.php of the component/com_visforms/views/visforms/tmpl, if you use the module you have to change the default.php in modules/mod_visforms/tmpl/default.php).
Use
Code:
(isset($field->show_label) && ($field->show_label == 1))

(for example in a php if statement) to hide the label, according to the show label parameter settings of the fields. The label starts about line 355 in the default.php
The placeholders should show up without any further coding

4) Add the required star behind the input for fields that show now label. Use the same condition as above to enclose the code that produces the required star, which is:
Code:
<?php if (isset($field->attribute_required) && ($field->attribute_required == 'required')) { ?> &nbsp;<span class="vis_mandatory">*</span> <?php } ?>

The input is closed by the $field->htmlTag in an if then else statement. Add the required star after the closing } of the else of that statement

5) Enable placeholder support for as many browsers as possible
Add the following javascript code at the end of the script tag in the default.php (just before the closing script tag).
Code:
//mend missing placeholder support in some browsers (function ($) { $.support.placeholder = ('placeholder' in document.createElement('input')); })(jQuery); //fix placeholder for IE7, IE8 and IE9 jQuery(document).ready( function () { if (!jQuery.support.placeholder) { jQuery("[placeholder]").focus(function () { if (jQuery(this).val() == jQuery(this).attr("placeholder")) jQuery(this).val(""); }).blur(function () { if (jQuery(this).val() == "") jQuery(this).val(jQuery(this).attr("placeholder")); }).blur(); jQuery("[placeholder]").parents("form").submit(function () { jQuery(this).find('[placeholder]').each(function() { if (jQuery(this).val() == jQuery(this).attr("placeholder")) { jQuery(this).val(""); } }); }); } });

Good Luck and Kind 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 :-).

Moderatoren: Administrator AVAdministrator IV
Powered by Kunena Forum