Expand my Community achievements bar.

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

Lock Text Field after selection of Drop-Down Menu

Avatar

Level 2

My pdf form is attached. All I would like to do is to lock the text field once "Add" is selected from the drop-down menu. Can anyone help me with this? Thanks!

2 Replies

Avatar

Former Community Member

// form1.#subform[0].DropDownList1::exit - (JavaScript, client)

if (this.rawValue == "Add") {

  TextField1.access = "protected";

}

else {

  TextField1.access = "";

}

Avatar

Level 6

Hope here lock means Protected / readOnly access to text field, is this correct?

if so can be done on Change or Exit events using javascript

here is the script

if(xfa.event.newText == "Add") //if need on exit event try with if(this.rawValue == "Add")

{
TextField1.access = "protected"; //TextField1.access = "readOnly";
}else{
TextField1.access = "open";
}

Hope this will help.

RAGHU.