Copy link to clipboard
Copied
Hello 🙂 I'm looking for some help on trying to fullfill this requirement I'm working with, I'm not sure if this is doable though or not.
I have a List Box with multiple selections enabled. One of the fields that can be selected is called "Other". If Other is selected, then a text field underneath the List Box should be set to read only false (user can enter input). If the Other option is deselected, the text box should go back to read only.
I've noticed that in the List box options it doesn't appear that you can select both "Multiple selection" and "Commit selected value immediately". This makes me think this might not be possible since I was under the assumption the Commit selected value immediately option needs to be checked for this to work properly, but if it is I'd like to know what the approach is. I'm assuming the script will be under List Box Selection Change -> Execute this Script -> code to check if list box array has Other selected. I'd appreciate the help and I attached a Test PDF to show what I mean. Thanks,
Daniel
Copy link to clipboard
Copied
It is possible, but it will only update once you exit the field.
You can do it using this code as the custom calculation script of the OtherBox text field:
var list = this.getField("ListBox1").value;
if ((typeof list=="object" && list.indexOf("Other")!=-1) || (typeof list=="string" && list=="Other")) {
event.target.readonly = false;
} else {
event.target.readonly = true;
event.value = "";
}
Copy link to clipboard
Copied
It is possible, but it will only update once you exit the field.
You can do it using this code as the custom calculation script of the OtherBox text field:
var list = this.getField("ListBox1").value;
if ((typeof list=="object" && list.indexOf("Other")!=-1) || (typeof list=="string" && list=="Other")) {
event.target.readonly = false;
} else {
event.target.readonly = true;
event.value = "";
}
Copy link to clipboard
Copied
Thank you! This was very helpful.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more