Question

I want a Text Field to appear when a certain item is chosen from a drop-down list. I'm using a change event.

if(this.rawValue == 1){
Tolerance.presence = "visible";
}
else{
Tolerance.presence = "hidden";
}

The problem is that the Text Field presence does not change immediately when a selection is made, but only after I go back to the list box and select again (any value, not just the same one).

Était-ce utile?

La solution

The new value of the dropdown only registers after the change event. This means this.rawValue points to the old value of the dropdown in a change event.

Either move your script dropdown exit event or make use of the event.newText in the if conditional in the change event.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top