Expand my Community achievements bar.

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

How to change a text field value based on a drop down menu selection?

Avatar

Level 2

Hello experts.

I have a simple form with a very long drop down list and two textboxes.  I am using an array to populate textbox1 based on a value chosen in the drop down list, and this works as intended.  Just a few of the values in the drop down list, but not all, should cause textbox2 to become read-only.

Does anybody have a sample script for this?  Any help would be greatly appreciated.

I am using LiveCycle Designer ES 8.2 on Windows Vista 32bit.

Thanks,

Jerald

1 Accepted Solution

Avatar

Correct answer by
Level 10

You can make the TextField2 as readonly by using the Script based on the value from the Dropdown.

if(dropdoqn1.rawValue == "<ENTER VALUE HERE>"){

     TextField2.access = "readOnly";

}

You can change the above script as you need..

Thanks

Srini

View solution in original post

4 Replies

Avatar

Correct answer by
Level 10

You can make the TextField2 as readonly by using the Script based on the value from the Dropdown.

if(dropdoqn1.rawValue == "<ENTER VALUE HERE>"){

     TextField2.access = "readOnly";

}

You can change the above script as you need..

Thanks

Srini

Avatar

Level 2

Thanks for such a quick response.  I tried the following using change event:

if(this.rawValue=="Acquisition of Real Property ")

{activityTxcdbgEngineeringAmountNum.access="readOnly"}

but it didn't work.  Any ideas on what I'm doing wrong?

Thanks,

Jerald

Avatar

Level 2

Sorry.  It works now...I forgot the semi-colon.

Thanks for your help.

Avatar

Level 10

If you are using the change event, using rawValue will give you some unexpected results..

Try using xfa.event.newText to get the predictable results..

Thanks

Srini