• Resolved mwbarican

    (@mwbarican)


    Hi,

    I’m new at using this plugin. Can anyone assist on how I should set up a scenario like below?

    I have 3 dropdown fields and each field has 3-4 options.

    If field A’s dropdown value is selected as option2, field B’s value will change to its option2 value and will be disabled so the user can’t change it.

    Any help is much appreciated.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @mwbarican,

    The behavior you are requesting is very specific to your project, and actually, it is not related directly with our plugin. You would need some of javascript code to implement it.

    Assuming that the dropdown fields are: the fieldname1 and fieldname2:

    You should insert a “HTML Content” field in the form with a code similar to the following one as its content:

    <script>
    jQuery(document).on('change', '[id*="fieldname1_"]', function(){
    jQuery('[id*="fieldname2_"]').prop('selectedIndex', this.selectedIndex).prop('disabled',true);
    });
    </script>

    and that’s all.

    Note that the fields’ names are assigned dynamically, so, you should replace the fields names in the previous piece of code.

    If you need additional help implementing this custom behavior in your form, I can offer you a custom coding service from my private website:

    https://cff.dwbooster.com/customization

    Best regards.

    Thread Starter mwbarican

    (@mwbarican)

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable field when a specific value is selected’ is closed to new replies.