Expand my Community achievements bar.

SOLVED

Presence problem when using a drop-down menu

Avatar

Level 3

I am trying to show/hide a table when a choice is made from a drop-down menu. It doesn't work until I make the same choice twice, then I get the expected result. The script is under Change and I have used it before successfully, albeit it has typically been using a check box. Is there an easy fix hopefully for this problem? Code below:

if

(this.rawValue == 2)

{

form1.Page1.OrderSection.OrderItems.Blower.presence

= "visible";

}

else

{

form1.Page1.OrderSection.OrderItems.Blower.presence

= "hidden";

}

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 6

Drop-down lists work a little differently than expected; in the Change event the rawValue contains the previously selected text.  That's why it works the second time.  The current selection is contained in: xfa.event.newText

View solution in original post

4 Replies

Avatar

Former Community Member

I think the property value you want is "invisible".

Avatar

Level 3

Nope, that's not it. Needs to be Hidden as opposed to Invisible, and doesn't with that either. The issue is why does the drop-down value have to be chosen twice instead of once to work?

Avatar

Correct answer by
Level 6

Drop-down lists work a little differently than expected; in the Change event the rawValue contains the previously selected text.  That's why it works the second time.  The current selection is contained in: xfa.event.newText

Avatar

Level 3

That was it. I was able to find an example of that code used somewhere and change it to make mine work. Thanks