Skip to main content
Ryan_Oliver_02445
Known Participant
January 31, 2019
Answered

How to test whether a drop down box is empty

  • January 31, 2019
  • 1 reply
  • 1188 views

Good evening I am attempting to create large if-then structured built into Functions.

However, I am running into the problem of not being able to write IF-ELSE statements, when the argument is whether a drop-box is empty, or not.

Here is an example:

var dropBox = this.getField("Drop Box)";

var SourceField = this.getField("Source");

if (dropBox.valueAsString != "") {

  console.println(sourceField);

}

Even if Drop Box has no strings selected, it still won't complete the statement.

Any help would be greatly appreciated!

This topic has been closed for replies.
Correct answer try67

Then it should work if that value is selected... What is the outcome of running this code?

1 reply

try67
Community Expert
Community Expert
January 31, 2019

What's the default value of the drop-down?

Ryan_Oliver_02445
Known Participant
January 31, 2019

The drop-box has a blank entry as its default

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
January 31, 2019

Then it should work if that value is selected... What is the outcome of running this code?