• Resolved morriscookies

    (@morriscookies)


    Hi, is there any option to add rules for MultiChoice to make it minimum required as one choice and maximum of 3 choice ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Form Maker Support

    (@formmakersupport)

    Dear Morris,

    Please try the following.

    Add the below mentioned code in Forms > Form Options > Javascript
    section

    $(document).ready(function(){
        var limit = 3;
        $('input[type=checkbox]').on('change', function(evt) {
             console.log($("input[type='checkbox']:checked").length);
             if($("input[type='checkbox']:checked").length > limit) {
                  this.checked = false;
             }
        });
    })

    Please try and provide the feedback.

    Thanks, have a nice day!

    Thread Starter morriscookies

    (@morriscookies)

    Hi, the code above doesn’t work, please find below link and code location whether is correct not :

    https://kaawei.co.uk/diy-cookies/

    View post on imgur.com

    Thanks.

    Plugin Contributor Form Maker Support

    (@formmakersupport)

    Hi Morris,

    Sorry for the inconvinence. Please try to add this code.

    jQuery(document).ready(function(){
       var limit = 3;
       jQuery('#9form_view1 input[type=checkbox]').on('change', function(evt) {
            console.log($("#9form_view1 input[type='checkbox']:checked").length);
            if($("#9form_view1 input[type='checkbox']:checked").length > limit) {
                 this.checked = false;
            }
       });
    })

    Thanks, have a nice day!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘MultiChoice rules’ is closed to new replies.