Nintex Forms – Conditionally Set DropdownList Value

If you want to set the default selected value in a dropdown list according to the value in another dropdown list (or any other control on the page), the following code will be useful.

First of all, assign an ID or define a class to your controls so that you can access them with jQuery. In my example, I have assigned the class “FirstDropdown” to the drop-down list whose condition I will check. According to this condition, I assigned the “SecondDropdown” class to the drop-down list whose value I will set.

If the value selected in the first drop-down list is “VALUE1”, I want the value “TRUE” to be automatically selected in the second drop-down list. For all other conditions, the “FALSE” option should be selected.

NWF$(document).ready(function () {
    NWF$(".FirstDropdown").change(function () {
        if (NWF$(".FirstDropdown :selected").text() == "VALUE1") {
            NWF$(".SecondDropdown" + " option:contains('TRUE')").attr("selected", true);
        } else {
            NWF$(".SecondDropdown" + " option:contains('FALSE')").attr("selected", true);

Add a Comment

Your email address will not be published. Required fields are marked *