Reset dropdown controls by changin options in nintex 365.

  • 2 November 2017
  • 7 replies

Hello Team,

I am trying to reset a dropdown control based in a checkbox, I would like you to check my code and give me some feedbacks, I have done something similar in Nintex on-premisses but this solution is not working for nintex form 365...

Here is the script that I am using:

NWF$(document).ready(function(){ var obj = NWF$("#" +Driverc); obj.change(function(){NWF$("#" + Transporttoc).val('');} );} );

The checkbox driver appear if the option "From Airport to Hotel" is selected in the dropdown, otherwise desappear.

Now what I need is: If checkbox has been selected and then the user realized that is not necesary and uncheck it, then reset the dropdown.

Thanks in advance


Best answer by TomaszPoszytek 2 November 2017, 22:22

View original

7 replies

Badge +17


The code you provided should work in my opinion... To be sure, that the dropdown gets reset only when checkbox is unchecked, you can add a rule to be verified:

NWF$(document).ready(function () {
    NWF$("#" + Driverc).change(function () {
        if (!NWF$(this).prop('checked'))
            NWF$("#" + Transporttoc).val('');

Alternatively you can try to clear your dropdown selection using:

NWF$("#" + Transporttoc + " option:selected").removeAttr("selected");

But I think the "val('')" is enough.




Thank you for your answer,

Is weird, now i am getting the error "The App Nintex Forms for Office 365 is out of date". Please update it.

I am not sure if I need make any update or something like that... Is the first time that I run into. 

Badge +17

Maybe try to refresh the window. I personally haven't seen anything like that ever




You'll get that error whenever something is "wrong" with the Javascript.   It is usually syntax related.

Hey Tomasz

How would the code look like if the checkbox is a choice instead?

I been trying to use this:

var freightChoice = NWF$("#" +FreightCharges);
NWF$("#" + showProjectNumbers + " option:selected").removeAttr("selected");
} );
} );

the FreightCharges is the choice of 4 options and I like the dropdown field (showProjectNumber) to be reset as soon as the choice options have changed. If I get this to work then I will add more fields to reset based on same principle ...

the above code, does not work  


The script works when setting "Cliend ID JavaScript variable name" to YES and referencing it!

However, the dropdown field does not default back to its original state ...

Also tried with the below code but not working:

NWF$("#" + Transporttoc + " option:selected").removeAttr("selected");

Any suggestions?


Finally got it to work as I wanted

var freightChoice = NWF$("#" +FreightCharges);

} );
} );

This now resets the dropdown value to "Please select..." for a vLookup field.

If you have a normal dropdown field then you need to implement the following:

NWF$("#" + selectProjectNumbersValue + " option:selected").removeAttr("selected");