Calculations in 2 different forms

Home Forums Quform WordPress Calculations in 2 different forms

This topic is: not resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #31248
    zittis
    Participant

    I have followed the instructions in this link (https://support.themecatcher.net/quform-wordpress-v2/guides/advanced/calculations) for one of my forms to do some calculations. The calculations work perfectly.

    I have created a second form where i want to add another calculation.

    Will the calculations in the second form affect those in the first form? Do I have to do anything else in the code?

    I am attaching the 2 calculations files.

    Thank you in advance.

    Attachments:
    You must be logged in to view attached files.
    #31275
    zittis
    Participant

    Have you manage to have a look at this issue?

    #31279
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #31293
    zittis
    Participant

    Pls help

    I added this in the html
    <div id=”form-total2″></div>

    Then added this code but still it doesnt work:

    jQuery(function ($) {
    var calculate = function () {
    var total = 0;

    // Week 1
    if ($(‘.quform-field-6_255_1’).is(‘:checked’)) {
    total += 100;
    }
    // Week 2
    if ($(‘.quform-field-6_255_2’).is(‘:checked’)) {
    total += 100;
    }
    // Week 3
    if ($(‘.quform-field-6_255_3’).is(‘:checked’)) {
    total += 100;
    }
    // Week 4
    if ($(‘.quform-field-6_255_4’).is(‘:checked’)) {
    total += 100;
    }
    // Week 5
    if ($(‘.quform-field-6_255_5’).is(‘:checked’)) {
    total += 100;
    }

    // Display the result to the user
    $(‘#form-total2’).text(‘€’ + total);

    // Set the value of the hidden field
    $(‘.quform-field-6_196’).val(” + total);
    };

    // Calculate on page load
    calculate();

    // Recalculate when these checkboxes or radio buttons are clicked
    $(‘.quform-field-6_255_1, .quform-field-6_255_2, .quform-field-6_255_3, .quform-field-6_255_4, .quform-field-6_255_5).click(calculate);

    });

    #31297
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #31350
    zittis
    Participant

    Thanks again very much Ally.

    One more thing please. How can I disable on of the checkboxes options. I don’t want to delete it, just disable it so that the user won’t be able to select it.

    Thanks again.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2019 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy