Calculations in 2 different forms

Home Forums Quform WordPress Calculations in 2 different forms

This topic is: resolved
Viewing 14 posts - 1 through 14 (of 14 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.

    #31384
    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.

    #31431
    zittis
    Participant

    Thank you very much. Your support rocks!

    #31703
    zittis
    Participant

    Is there a way to disable an option from a select menu (dropdown list)?

    I can do that using radio buttons and check boxes.

    #31710
    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.

    #31711
    zittis
    Participant

    Thank you very much

    #32240
    zittis
    Participant

    Here comes Form number 3 with calculations. I have made 2 other forms already that have calculations. The form is here: https://www.gcsc.ac.cy/secondary/examinations-selection-2021/

    But I always get a zero in my calculation.

    I am attaching the code I added in Custom JavaScript.

    Can you pls help me?

    Thank you.

    Attachments:
    You must be logged in to view attached files.
    #32248
    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.

    • This reply was modified 4 years ago by Ally.
    #32250
    zittis
    Participant

    Thanks man. You are really great!

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