Skip to main content
Nintex Community Menu Bar

Reset Dropdown list using JavaScript

  • January 29, 2019
  • 3 replies
  • 167 views

Forum|alt.badge.img+1

In Nintex 2013 form, I want to use a button using JavaScript to reset several dropdown lists containing corporate departments.  I have searched for examples but nothing works.

3 replies

Forum|alt.badge.img+7
  • January 29, 2019

To reset a drop down control with a button, you can use the following process:

Form Layout:

222755_pastedImage_1.png

Choice Control Settings:

222756_pastedImage_2.png

Button Control Settings:

222757_pastedImage_6.png

JavaScript Code in Form Settings:

222758_pastedImage_8.png

Code:

function ddClear() {
NWF$('.ddClass').val('**SelectValue**');
}

End Result when Button is Clicked:

222759_pastedImage_9.png

Explanation:

Since the code is using a CSS class (ddClass), you can apply that same class to all drop down controls and they will all clear at the same time when the button is clicked once.


Forum|alt.badge.img+7
  • January 29, 2019

As long as the other drop downs do not have the Control CSS Class of ddClass set (see below), they won't be affected by the Clear Button.
222760_pastedImage_2.png

Simply leave that field blank on the drop downs you don't want cleared.


Forum|alt.badge.img+1
  • Author
  • January 29, 2019

Thank you this does work perfectly, once I put the ddclass only in the dropdown lists I need cleared.