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.

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

Calculation field, test value

Mehr
3 Wochen 4 Tage her #11255 von geert@huizechaos.be
Calculation field, test value wurde erstellt von geert@huizechaos.be
Hello,
I'm using a calculation field to compute a sort of checksum on user input data. The result of the calculation should be 0. 
I want to block the user from submitting if this result is not 0, how can I do that? It would be easy if the calculation field had an 'Equal To' option. Or should I go the 'regex' route?

Thanks,
Geert

Mehr
3 Wochen 3 Tage her - 3 Wochen 2 Tage her #11274 von Administrator IV
Administrator IV antwortete auf Calculation field, test value
Hello Geert,

There was a very similar question about the field type 'Calculation' a week ago.

Is it possible to validate the calculation? Validate calculation?
vi-solutions.de/de/forum/19-joomla-exten...te-calculation#11190

The result is the development of a new feature:
vi-solutions.de/de/forum/19-joomla-exten...te-calculation#11201

I had created an issue for development in the wish list:
Issue [VF-1375] Forum: Calculation field: Add Validation for calculation result

When we release the new feature, you will also be explicitly informed about the release here in your topic.

Solution until then Option 1:

Until then, it is necessary to write some of your own JavaScript:
- Every time the calculated value changes
- you check your condition
- and as long as it is not met
- you deactivate the submit button and
- write a message in a suitable place.

You can achieve the behavior with some custom CSS/JavaScript and the Visforms 'Frontend Webassets'.
Frontend Web Assets:
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

Solution until then Option 2:

One option for developers is to create a custom plugin:
- After submitting the form
- you check in the backend on the server
- whether your condition
- and as long as it is not met you send the form back with a message.

The documentation describes how to create a 'Visforms Custom Plugin'.

Custom plugin creation:
docs.joomla-4.visforms.vi-solutions.de/e...-plugin-development/
Custom plugin event system:
docs.joomla-4.visforms.vi-solutions.de/e...-plugin-development/
There is a complete custom plugin with all events and help functions as a template that comes with the installation of Visforms:
docs.joomla-4.visforms.vi-solutions.de/e...-plugin-development/

The developer can then decide for himself what else should happen.
Creating a custom plugin requires some PHP development experience on Joomla.

Notes:

Option 1 occurs early.
Option 1 could be circumvented by a hacker by making changes within the displayed page, as it is a purely client-side solution in the web browser.

Option 2 comes later.
Option 2 is secure against changes by hackers.

A combination of option 1 and option 2 would be ideal.

Best 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 Wochen 2 Tage her von Administrator IV.

Mehr
3 Wochen 2 Tage her #11278 von geert@huizechaos.be
geert@huizechaos.be antwortete auf Calculation field, test value
Hi Ingmar,
The temporary solutions are beyond my understanding but Maybe I can suggest a new field type : Protected Number.
It works like this :
A protected number consists of a number of figures and a number of check figures. The check is done by calculating the remainder of the division of the first group of figures by some (mostly) prime number (mostly 97).
The calculated remainder must equal the number formed by the check figures, otherwise the field is 'illegal'.
This system is used for bank account numbers, national numbers etc... (in Belgium at least).
I used this formula in my calculation field, the result must be 0 but I can only display the value with no possibility of blocking entry when the value is not 0.

([STAALNR]-round(([STAALNR]/100)-0.5)*100)-(round(([STAALNR]/100)-0.5)-round((round(([STAALNR]/100)-0.5)/97)-0.5)*97)

It would be useful to have this kind of entry in a field type, with numbers of figures and dividor as parameters of course.

Best regards,
Geert
PS We are doing scientific research on honey bees, each month 40 beekeepers take samples of 150 hives. The sample containers are pre-numbered with a protected number of 4+2/97 figures. When they enter the sample number in a form it would be nice to block entry if the sample number does not check ok.

Mehr
3 Wochen 2 Tage her #11279 von geert@huizechaos.be
geert@huizechaos.be antwortete auf Calculation field, test value
I wrote 'figures' but of course I meant 'digits'....

Mehr
2 Wochen 5 Tage her #11290 von Administrator IV
Administrator IV antwortete auf Calculation field, test value
Hello Geert,

we're thinking about it.

Your description is clear but at least for me it is partly incomprehensible or incomplete.
In particular, the formula mentioned does not solve the entire calculation situation, as far as I can see.
I therefore have the following questions so that I understand you correctly and misunderstandings are excluded.

Question 1:

Could you please describe a complete general case and a specific case that includes the following:
- three input numbers,
- 1. the input number (INO) and
- 2. the control number (CNO) and
- 3. the divisor number (DNO),
- all necessary calculations or the complete calculation with all aspects.

Question 2:

How many inputs does the user make and what are they?
(Two inputs with INO and CNO?)

Question 3:

How widespread is the procedure actually and is the type of calculation always the same?
What is not meant is the different number of numerical digits and the specific CNO.

Unfortunately, I cannot create an issue if I do not know exactly what it contains and how it is to be implemented.

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

Mehr
2 Wochen 11 Stunden her #11302 von geert@huizechaos.be
geert@huizechaos.be antwortete auf Calculation field, test value
Hi Ingmar,
We have been very busy with the bees, not to mention the spring trapping of the Asian hornet queens...
I'm glad my idea about a 'protected number' cought your attention.
The formula I sent in a previous post works for a PN where DNO is 97, the user input is INO concatenated with CNO, thus a single input.
Example : User input 397494 is composed of INO 3974 and ICO 94. This means that to be valid the (remainder of (INO div DNO)) or (INO rem DNO) has to be = ICO.
So in this case the user enters 397494 as 'sample number' where 3974 is the 'real' sample number and 94 is the CNO.
Important : all of these operations are of course done on 'integer' numbers.

I'll try to put together a 'generic' formula with INO number of digits and DNO value but it will not be simple, I'm no mathematician. Maybe I'll have a look on the internet...

Thanks for your help,
Geert

 

Moderatoren: Administrator AVAdministrator IV
Powered by Kunena Forum