• Resolved dropshot

    (@dropshot)


    Hi,

    What is the Minimum/Maximum Value for?

    I thought I could use this for validation, if the calculated number is less than minimum value the form could not be sent.

    I think I was mistaking.

    I’m using the CF7 as a simple order form. The calculator returns the order value. But I need to set a minimum order value limit. Is this possible with this plugin?

    Cheers!

Viewing 1 replies (of 1 total)
  • Plugin Author pbosakov

    (@pbosakov)

    The minimum value is not used for validation, but will simply force the calculation result to be a certain number if the formula resolves to something that is less than that.

    For example, if your minimum value for the a+b calculation is 10, you will get something like this:

    a b a+b
    1 1 10
    2 2 10
    3 3 10
    4 4 10 
    5 5 10
    6 6 12
    7 7 14
    8 8 16

    You can attach your own validation Javascript to the “wpcf7calculate” jQuery event, for example:

    jQuery('form').on('wpcf7calculate', function() {
        var total = jQuery('input[name=total]').val();
        var minimum = 20;
        if (total < minimum) {
            jQuery('input[type=submit]').prop('disabled', true);
            alert('Order minimum is 20');
        } else {
            jQuery('input[type=submit]').prop('disabled', false);
        }
    });
Viewing 1 replies (of 1 total)
  • The topic ‘Minimum/Maximum Value – Doing what?’ is closed to new replies.