Multiply

Home Forums Quform WordPress Multiply

This topic is: resolved
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #26826
    ArieNuis
    Participant

    Hi,

    I have used the following link https://support.themecatcher.net/quform-wordpress-v2/guides/advanced/calculations
    to make some calculations and it works perfect! See https://www.dfd.nl/inboedelwaardemeter

    Now i want in the last field “Totaal inboedelwaarde: ” to make a multiply from field “Totaal aantal punten:” X 1012

    Do you have an excample/solution for this?

    This is the JS calculation in use:

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

    // Check if a checkbox is ticked
    if ($(‘.quform-field-15_3_1’).is(‘:checked’)) { total += 20;
    }

    // A radio button
    var val4 = $(‘.quform-field-15_23:checked’).val();
    if (val4 == ’35 jaar en jonger’) {
    total += 22;
    } else if (val4 == ’36 tot en met 50 jaar’) {
    total += 29;
    } else if (val4 == ’51 tot en met 70 jaar’) {
    total += 39;
    } else if (val4 == ’71 jaar en ouder’) {
    total += 37;
    }

    // A radio button
    var val2 = $(‘.quform-field-15_36:checked’).val();
    if (val2 == ‘Alleenstaand’) {
    total += 0;
    } else if (val2 == ‘Gehuwd/samenwonend’) {
    total += 10;
    }

    // A radio button
    var val4 = $(‘.quform-field-15_43:checked’).val();
    if (val4 == ‘Tot en met € 1.000,-‘) {
    total += 0;
    } else if (val4 == ‘€ 1.001,- tot en met € 2.000,-‘) {
    total += 10;
    } else if (val4 == ‘€ 2.001,- tot en met € 3.000,-‘) {
    total += 17;
    } else if (val4 == ‘€ 3.001,- tot en met € 4.850,-‘) {
    total += 28;
    }

    // A radio button
    var val4 = $(‘.quform-field-15_50:checked’).val();
    if (val4 == ‘Tot en met 90 m2′) {
    total += 0;
    } else if (val4 == ’91 m2 tot en met 140 m2’) {
    total += 6;
    } else if (val4 == ‘141 m2 tot en met 190 m2’) {
    total += 18;
    } else if (val4 == ‘191 m2 tot en met 300 m2’) {
    total += 23;
    }

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

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

    // Calculate on page load
    calculate();

    // Recalculate when these checkboxes/radio buttons are clicked
    $(‘.quform-field-15_3, .quform-field-15_23, .quform-field-15_36, .quform-field-15_43, .quform-field-15_50’).click(calculate);
    });

    #26856
    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 7 years ago by Ally. Reason: Fix code error
    #26871
    ArieNuis
    Participant

    Thanks Ally!

    Your code was not complete.
    But when i put this line after your code then it works!

    $(‘#form-total2’).text(” + total2);

    Regards,

    Arie Nuis

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

    #26929
    ArieNuis
    Participant

    Hi Ally,

    Simple question as a follow-up;
    How can i put these values in a e-mail confirmation? Total and total2.

    Regards,

    Arie Nuis

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

    #26942
    ArieNuis
    Participant

    Thanks Ally,

    Works great!

    Regards,

    Arie

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