• Resolved lew1s

    (@lew1s)


    Hi, I am using this plugin and want to set up min and max but its not working at all. Do you have some bug in the plugin? Thanks

    My example:
    <label>Váha balíka:
    [number number-609 min:10 max:1000]</label>
    [calculate_button id:vyrataj “vyrataj”]
    <label>[calculation vysledok id:vysledok “vaha * 2.2”]€</label>

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author pbosakov

    (@pbosakov)

    Hi, with this plugin the min/max option applies to the calculation result, not the input field. Therefore, you can do something like this:

    [calculation vysledok id:vysledok min:22 max:2200 “vaha * 2.2”]

    The input fields are handled by the Contact form 7 plugin so if you need to restrict the input, you may ask for a possible solution in the CF7 support forum.

    Thread Starter lew1s

    (@lew1s)

    Yes this is working with the arrows, but when you type number under 10 the total sum will be 22 anyway. So the minimum price is 22.
    1*2.2=22
    2*2.2=22
    3*2.2=22
    4*2.2=22
    5*2.2=22
    6*2.2=22
    7*2.2=22
    8*2.2=22
    9*2.2=22
    10*2.2=22
    11*2.2=24.2
    ..and so on..

    • This reply was modified 5 years, 2 months ago by lew1s.
    Plugin Author pbosakov

    (@pbosakov)

    You can try adding this JavaScript snippet to your website to enforce min/max attributes strictly.

    jQuery(function($) {
        $('input[type=number]').on('change', function() {
            var min = $(this).attr('min');
            var max = $(this).attr('max');
            var val = parseFloat($(this).val());
            if (val > max) {
                $(this).val(max);
            }
            if (val < min) {
                $(this).val(min);
            }
        });
    });
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘min max not working’ is closed to new replies.