Expand my Community achievements bar.

Drop Down -allow custom text entry via script

Avatar

Level 3

Hi ,

I have a requirement where I want to allow the custom text entry on a drop down at runtime via script.If one particular value is selected i do not want it to be editable else i need to allow custom text entry.

Can anyone help me out with teh script to do so?

Regards,

Leena

2 Replies

Avatar

Level 10

Hi,

Here is an example: https://acrobat.com/#d=hLhn-RXP6B25gY*zz2ykLQ

If you set the following script in the change event of the dropdown:

var vName = this.name.toString();


if (xfa.event.newText == "Apples")

{

     xfa.resolveNode(vName + ".ui.choiceList").textEntry = "1";

}

else

{

     xfa.resolveNode(vName + ".ui.choiceList").textEntry = "0";

}

You will be able to edit the "Apples" selection.
Hope that helps,
Niall