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.

Mass calculation of all calculation forms

Mehr
4 Monate 2 Wochen her #9922 von L_Cypherus
Mass calculation of all calculation forms wurde erstellt von L_Cypherus
Hello

I have a reservationform with lots and lots of different calculation cells.
Example (in dutch but you'll get what I mean by looking ;-)) www.degedektetafel.be/wv2/index.php/reserveringsformulier

I want a mass calculation to show them the total price of every cell combined.

Is this possible on an easy way or do I have to start a calculationform setings [CELL1]+[CELL2]+[CELL3]....

Mehr
4 Monate 2 Wochen her #9923 von MaliRaj
you start a calculationform setings ...

Freundliche Grüße aus PM
Heinz
Folgende Benutzer bedankten sich: Administrator IV

Mehr
4 Monate 2 Wochen her - 4 Monate 2 Wochen her #9926 von Administrator IV
Administrator IV antwortete auf Mass calculation of all calculation forms
Hello L_Cypherus,

There is another option with a little bit of JavaScript and the Visforms 'Frontend Webassets'.

Frontend Webassets:
docs.joomla-4.visforms.vi-solutions.de/e...-frontend-webassets/
All settings are made in the form:
docs.joomla-4.visforms.vi-solutions.de/e...are-made-in-the-form

With the following small JavaScript you can sum up any number of fields in one go and output the sum in a result field:
Code:
// calculate sum of field group labeled by common CSS-class 'css-number-add' jQuery(document).ready(function() {     console.log('FEWA script loaded');     jQuery('.css-number-add').bind('change keyup mouseup mousewheel', function() {         // re-calculate on value change         calculateSum();     });     jQuery('.visform').bind('visformsInitialised', function() {         // re-calculate on form is initialized         calculateSum();     }); }); function calculateSum() {     let sum = 0;     jQuery('.css-number-add').each(function() {         let val = jQuery(this).val();         // skip all of: is not a number         if(isNaN(val)) return true;         // keep multiplication with 1, otherwise it would be a simple string concatenation         sum += 1 * val;     });     jQuery('.css-number-add-result').val(sum); }

The form:
vi-solutions.de/forum-uploads/fewa-examp...-fields-sum_form.png

The procedure:
1 - Set the field's own CSS class 'css-number-add' for all input fields for the total sum
The field configuration of the result field:
vi-solutions.de/forum-uploads/fewa-examp...sum_input-fields.png

2 - Set the field's own CSS class 'css-number-add-result' for the result field
The field configuration of an input field:
vi-solutions.de/forum-uploads/fewa-examp...sum_result-field.png

3 - Paste the above script in the form configuration, tab 'Frontend Webassets', there in the 'Form' tab into the 'JavaScript' text field
The form configuration, tab 'Frontend Webassets':
vi-solutions.de/forum-uploads/fewa-examp...-fields-sum_fewa.png

I have set the result field 'number-add-result' to 'read-only' in the field configuration.

Kind regards, Ingmar

: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: 4 Monate 2 Wochen her von Administrator IV.

Mehr
4 Monate 5 Tage her #9951 von L_Cypherus
L_Cypherus antwortete auf Mass calculation of all calculation forms
Thanks

For step 2 (Set the field's own CSS class 'css-number-add-result' for the result field.)

What field type does I have to take?

Mehr
3 Monate 4 Wochen her #9952 von L_Cypherus
L_Cypherus antwortete auf Mass calculation of all calculation forms
Thanks

For step 2 (Set the field's own CSS class 'css-number-add-result' for the result field.)

What field type does I have to take?

Mehr
3 Monate 2 Wochen her - 3 Monate 2 Wochen her #9955 von Administrator IV
Administrator IV antwortete auf Mass calculation of all calculation forms
Hello L_Cypherus,

there was no need to repeat the question.
We had 2 weeks of vacation until yesterday and there was a red notice at the top of all the forum pages:
vi-solutions.de/forum-uploads/forum_out-...ssage_2024-01-07.png

The form in the example has the type 'number' as the result field with the name 'number-add-result'.
The code also works for a result field of type 'Text'.

The same applies to the input fields.

So you can use the types 'Text' or Number' for the input fields and the result field.

Kind regards, Ingmar

: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: 3 Monate 2 Wochen her von Administrator IV.

Moderatoren: Administrator AVAdministrator IV
Powered by Kunena Forum