Avatar

Level 2

Ok, thanks Malcolm. Yes, you were correct about using the rawValue property to reset the selected value of the dropdown.

Why I got so confused is because all my scripting, including trying to reset the newly selected value, was done in the Change event of the dropdown. The rawValue property 'appears' to behave differently here I think because of the order of the events, where it holds the original value through the whole selection process. So essentially, the rawValue during the Change event doesn't hold the newly selected value and will not hold it until the Change event is fully completed.

So I was able to reset the selected value through the Exit event by using a form variable whose value I set in the Change event. So my Change event uses this line at the right location in my script:

cancelDDSelection.value = "yes";

and my Exit event uses the following;

if (cancelDDSelection.value == "yes") //if the Change event reset this form variable to 'yes'
{
this.rawValue = "Other"; //reset the selected value to 'Other'
cancelDDSelection.value = "no"; //reset the form variable to its default value
}

Not sure if there's a better to do this, but all works as I wanted it to now.

Marc