Copy link to clipboard
Copied
How can I find & show/hide form fields with a specific strings start with "List1_", "List2_" in the field name and make them hidden until triggered.
I need the regular expression format to find the form fields name start with "List1".
this.getField("List1_Oldfactory").display = display.hidden;
this.getField("List1_Optical").display = display.hidden;
this.getField("List1_Glosso").display = display.hidden;
this.getField("List1_Trigeminal").display = display.hidden;
this.getField("List1_"+(/\s/g)).display = display.hidden;
TypeError: this.getField(...) is null 1:Field:Mouse Up
You can do it like this:
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
if (f==null) continue;
if (/^List1/.test(f.name)) f.display = display.hidden;
}
Copy link to clipboard
Copied
Please post the exact name of the Adobe program you use so a Moderator may move this message to that forum
Copy link to clipboard
Copied
[Moderator moved to Coding Corner.]
Copy link to clipboard
Copied
I am adding this script into Acrobat PDF, if possible please move to Acrobat.
Copy link to clipboard
Copied
You can do it like this:
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
if (f==null) continue;
if (/^List1/.test(f.name)) f.display = display.hidden;
}
Copy link to clipboard
Copied
Thanks for the script... It helps a lot!