Skip to main content
Ryan_Oliver_02445
Known Participant
Jan 31, 2019 4:24 PM UTC
Answered

How to test whether a drop down box is empty

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 is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Jan 31, 2019 6:22 PM UTC

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

4 replies

try67
Community Expert
Community Expert
Jan 31, 2019 4:41 PM UTC

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

Translate
Ryan_Oliver_02445
Known Participant
Jan 31, 2019 4:47 PM UTC

The drop-box has a blank entry as its default

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Jan 31, 2019 6:22 PM UTC

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

Translate