Expand my Community achievements bar.

SOLVED

Hide text in field when dropdown is selected

Avatar

Former Community Member

Hello,  I am looking for a way to hide text in a text field when a certain selection is made from a dropdown list. For example, I have a table with text field that have a pre-populated line of text in them. I would like the text to be removed if "Yes" is selected from a dropdown box allowing data entry into the now blank text box.   Here is what I have so far:

if (this.rawValue == "Yes"){ SubStandard_A.StandardPkgTbl.Row1.TextField2.rawValue == ""; }

I have tried .rawValue == "", .rawValue == null, .clearItems

Any help is greatly appreciated!

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Just spotted that your original script had a double == when assigning the value to the rawValue. You should only use the double == when testing equality.

Here is a sample.

Hope you get it working.

Niall

View solution in original post

4 Replies

Avatar

Level 10

Hi,

The script looks OK.

When putting script in a dropdown, check that it is in the exit event (when using .rawValue). If you have it in the change event, then you would need to access newText. The way your script is written it would go in the exit event of the dropdown.

Next check the binding of the dropdown. If the specify values is ticked, then that is what you need to reference in the script instead of "Yes". If the specify values is ticked then change "Yes" in the script for the bound value. Otherwise untick specify values.

Hope this helps,

Niall

Avatar

Former Community Member

Hello Niall,

Thanks for the reply...

I currently have the scripting in the exit event and the dd options are not bound, but it is not functioning as it is.

Any other insight on why this wouldn't function?

Thanks again!

Avatar

Correct answer by
Level 10

Hi,

Just spotted that your original script had a double == when assigning the value to the rawValue. You should only use the double == when testing equality.

Here is a sample.

Hope you get it working.

Niall