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.

Aufgrund von Feiertagen und Urlaub ist bei Anfragen im Forum in der Zeit vom 18. Mai 2024 bis zum 2. Juni 2024 mit verlängerten Antwortzeiten zu rechnen.

How to add javascript code in visforms

Mehr
7 Jahre 7 Monate her #3563 von cloudyHuang
How to add javascript code in visforms wurde erstellt von cloudyHuang
Hi ,Aicha

I made a upload file feature use visfroms。and I want to write javascript for the submit button。
just like ->
$(document).ready(function(){
$("#field3").click(function(){
code...
});
});

When I press the submit to upload the file,My javascript will also run。
now I want to know I should write my javascript code in which php file can be achieved。


Thanks

Mehr
7 Jahre 7 Monate her #3564 von cloudyHuang
cloudyHuang antwortete auf How to add javascript code in visforms
I added the code in ../media/com_visforms/js/visforms.js
$("#field3").click(function(){
window.alert('abc');
console.log('abc');
});


but the page no response

Mehr
7 Jahre 7 Monate her #3565 von Administrator AV
Administrator AV antwortete auf How to add javascript code in visforms
Hi,

basically you can create overrides of all files in the components/com_visforms/layouts folder in your template ( www.vi-solutions.de/en/documentations/vi...layout-with-override ) as well as of the files in the components/com_visforms/views/VIEWNAME/tmpl folder. (These are standard Joomla! features). The overrides in your template are not changed, when you update Visforms, so your code would be save there.

Nevertheless, as I'm continiously developing new features and try to improve Visforms, I sadly quite often have to change some of the files mentioned about. So although your overrides are not touched by an update, Visforms may no longer work, because your override file might miss something. So you might be required to adapt your override after a Visforms update. And the changes I make are sometimes quite severe.

I don't know which Visforms version you use, but just in Visforms 3.8.9 which was release only days ago, I added an option to the file upload field, which allows you to dynamically add a "remove selection" link to the upload field if a user has made a selection. So mayby this is just the feature you are looking for? Then maybe try Visforms 3.8.9. But as this is still a beta version, please make a full backup of your website first, so that you can return to the old state, if you are not happy with Visforms 3.8.9.

Visforms relies very much on and uses lots of Javascript (especially for the browser side form validation). I actually do not recommend to try to add custom javascript to Visforms (especially to the submit button) because this button strongly interacts with the validator plugin and your code will most probably not work as expected.

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