Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Setting drop down value twice on the same event

Avatar

Level 1

I have the following code on the change event of a drop down set to 'Allow custom text entry':

if

(xfa.event.newText == "Other:") {

     xfa.host.setFocus(

this);

     this.rawValue = "";

}

If the user selects "Other:", the value clears and the focus is set to the field so the user can enter custom text. However, this.rawValue = ""; isn't working. Is this because the code is trying to set a value twice on the same event? If so, do I need to use a different event and if so, which?

Thanks in advance.

1 Reply

Avatar

Level 10

Hi,

use this script:

if (xfa.event.newText == "Other:")

     {

     xfa.host.setFocus(this);

     xfa.event.change = "";

     }