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.

Set "clear-selection" link to always display

Mehr
1 Jahr 5 Monate her #8581 von Shaman
Hi devs,

I need to always display the "clear-selection" link on a file input field.
By default it is set to be hidden until a file is selected.

Even by queriing the field after document load, it can't be set to display.

This is the JS is use:
Code:
let clearfiles = document.querySelectorAll(".clear-selection");         for (let i = 0; i < clearfiles.length; i++) {             const clearfile = clearfiles[i];             clearfile.style.display = "block";         }

Can you help me please?

Kind regards,
Claude

Mehr
1 Jahr 5 Monate her - 1 Jahr 5 Monate her #8582 von Administrator IV
Administrator IV antwortete auf Set "clear-selection" link to always display
Hello Claude,

it works with the direct setting of the complete HTML attribute 'style'.
In addition, you also have to take care of the existing event handler.
So first remove the existing handler and then attach your own.

Your custom event handler is nothing more than a copy of the original minus the one line that hides the anchor.

The following code works for me:
Code:
jQuery(document).ready(function() {     jQuery('.clear-selection').each(function() {         jQuery(this).attr("style", "display: block;");         jQuery(this).off('click');     });     jQuery("a.clear-selection").on("click", function(e) {         let uploadid = jQuery(this).attr('data-clear-target');         let el = jQuery('#' + uploadid);         el.replaceWith(el.val('').clone(true));         // get the new jQuery object of el         el = jQuery('#' + uploadid);         el.trigger('keyup');         e.preventDefault();         return false;     }); });

Kind regards, Ingmar[/code]

: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 :-).
Letzte Änderung: 1 Jahr 5 Monate her von Administrator IV.
Folgende Benutzer bedankten sich: Shaman

Mehr
1 Jahr 5 Monate her #8583 von Shaman
Thank you Ingmar,

this works like a charm :-)

Kind regards,
Claude

Moderatoren: Administrator AVAdministrator IV
Powered by Kunena Forum