Sorry, should have said, I have a choice like in the first drop-down. 'Click to see options'
OK. You can use a custom Validate script in the 2nd dropdown that looks like the following:
// Validate script for dropdown
(function () {
// Get a reference to the label field
var f = getField("LABEL1");
// Show/hide the label based on the dropdown selection
f.display = event.value === "Click to see options" ? display.hidden : display.visible;
})();
but replace "LABEL1" with the actual name of the field you're using for the label text.
That last line is equivalent to the following:
if (event.value === "Click to see options") {
f.display = display.hidden;
} else {
f.display = display.visible;
}
This all could be simplified to the following single statement:
getField("LABEL1").display = event.value === "Click to see options" ? display.hidden : display.visible;
It's best if you select the "Commit selected value immediately" option for the dropdown. For the label field, make it read-only and set the default value to the label text.