• Resolved klinik

    (@klinik)


    Hi,
    I’ve tried to search but found no info about this.
    Is it possible to add custom javascript (for example) calculations ?
    It would be nice to use “if…then”, “do…while”, or to store values in variables for latter use (I’ve tried to use a calculation from a calculated field in a new calculated field but it didn’t worked, I had to concatenate all calculations in one very long formula).
    Thanks

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @klinik,

    I hope you are doing good.

    I am afraid it’s impossible to add a custom javascript as you add custom CSS on a Forminator form out of the box.

    Can you please explain the exact scenario that you need to solve to try to suggest a workaround?

    Kind Regards,
    Nebu John

    Thread Starter klinik

    (@klinik)

    Hi,
    I put 2 examples from my homebrewing calculations in the linked pdf. The first one is just annoying (in fact I’ve already made the form), but the second is limiting.
    1. The use of variables helps to simplify calculations by “cutting” a complex formula in smaller pieces. And since calculations from calculated fields doesn’t work doesn’t help.
    2. I use conditional loop for the priming syrup calculation.
    I can use GreenForms (such javascript calculations are available), and I use it in a NextCloud site, but I want to switch WP and Forminator.
    Maybe you have an idea ?
    Thanks again
    The linked pdf is here : linked pdf

    Hello @klinik !

    I’ve checked the issue you’ve mentioned regarding calculations from calculations on my test site and I was able to do that without any issue, ie. I can set a form like this:

    – number-1
    – calculations-1 = (number-1 * 2)
    – calculations-2 = (calculations-1 + 100)

    And that worked just fine out of the box, no issues on my end. I can also make the calculations-1 field hidden and it still works as expected. I’m not sure why it doesn’t work on your end this way actually – would you be able to share an export of the form so we can test that? (here’s how to export: https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export – please share the file via Google Drive as well)

    Regarding the second part – I’m afraid Forminator doesn’t support that yet as my teammate mentioned. We do have plans to extend the plugin in this way in the future though so I will add a comment on the task with a link to your ticket to let our team know.

    BTW, there is a way to create a sort of conditional logic using a bit of math tricks, please check my reply here: https://www.ads-software.com/support/topic/forminator-calculations/#post-14894830 – it’s not for all cases, but maybe it will help you with some parts of the calculations you have. If you have any questions about the equation there, please let us know!

    Warm regards,
    Pawel

    Thread Starter klinik

    (@klinik)

    Hi Pawel,
    I’ve checked again, it still doesn’t work I think.
    I send you a 7z file with :
    – the original form (without calculations from calculations since it didn’t worked for me, it’s a long form with 5 pages),
    – a copy of the form, shortened to 2 pages, and I have recreated the intermediate calculations,
    – a short video showing that it does not work.
    Maybe I’m doing something wrong ?
    Regards,
    Andrés
    The link : https://drive.google.com/file/d/1PBgdqEgEXm8SEufrPNb53hqQUrcb9Foj/view?usp=sharing

    • This reply was modified 2 years, 10 months ago by klinik.
    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @klinik,

    Thanks for sharing the form export. I could notice anomalies with your form export when tested, I tried a couple of tweaks to see whether it resolve the issue but I’m afraid the issue still remains the same.

    I’m escalating this further to our developer’s attention to see what exact instance is causing the issue.

    Will keep you posted once we get further feedback asap.

    Kind Regards,
    Nithin

    Thread Starter klinik

    (@klinik)

    Hi !
    Maybe it can help. Making another form I found that :
    -calculations from calculated fields are not executed until a refresh, maybe it’s possible to refresh by code ? in may form it’s done by hiding/showing the fields
    – the calculations are not exact ?
    I exported the form and made a little video here : https://drive.google.com/file/d/1HmTp7U_QeeIkQZD9EuAysKxQlhH42Vwm/view?usp=sharing

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @klinik,

    We just noticed that the initial issue with the 1st form export is more related to the “Copy” form that you have shared.

    If we test the “IBUs” form then the calculation works fine in there. Could you please confirm the same?

    Regarding the 2nd form export, I’m afraid there isn’t any way to refresh by code, if there are many complex calculations it could take some time for the results to display.

    I could notice the issue with calculations is quite similar with the calculations not working compared with the “Copy” form.

    I’m passing all these observations to our developer’s attention to further investigate the issues noticed.

    Will keep you updated asap.

    Kind Regards,
    Nithin

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @klinik,

    On checking further the issue with incorrect calculations seems to be due to a bug with “Separators” used in the “Calculations” Field. This is failing specifically for the “Calculation-2” field, ie:

    Screenshot at 14:04:00.png

    Changing the “Separators” to the following should resolve the issue with the incorrect calculation:

    Screenshot at 14:04:22.png

    The issue is specifically with the “calculation-2” field, so changing for that should be enough. However, to keep it uniform, you can use the above-suggested separators for other calculation fields until the issue is resolved in the next plugin update.

    Could you please check how it goes and whether the above makes any difference with the delay noticed?

    Kind Regards,
    Nithin

    Thread Starter klinik

    (@klinik)

    Hi, I will check. I cannot do it this week because I’m in trouble with another server.
    I will keep you informed.
    But my question is if this is only a “Forminator” bug, and if it will corrected in some future version. Thank you again.

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @klinik

    Sure, let us know when you were able to test it.

    In case it is a confirmed bug our developers will include in a future release yes, we can’t give an estimated time but you can follow our roadmap at https://wpmudev.com/roadmap/#forminator

    Best Regards
    Patrick Freitas

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @klinik ,

    We haven’t heard from you for some time now, so it looks like you don’t have more questions for us.

    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

    Thread Starter klinik

    (@klinik)

    As I’ve said, I’m just migrating from my old internet provider and making some adjustments. I will take all this stuff later. Regards,
    Andres

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Please confirm : no custom calculations ?’ is closed to new replies.