Copy link to clipboard
Copied
I keep getting this errror message
"TypeError: this.templates is null
4:Document-Level:myResetForm"
Here's the associated code
Copy link to clipboard
Copied
There are no Templates in the file, so the templates property returns null. You need to account for that in your code, like this:
if (this.templates!=null) {
for (var i = 0; i < this.templates.length; i++) {
this.templates[i].hidden = true;
}
}
Copy link to clipboard
Copied
You will get this error when the file has no template page.
Copy link to clipboard
Copied
Thank you Bernd for your response. So I know I originally had the file without templates, then added them. And the current file has templates. Adding these templates to a Cloud-saved file as a 'modification event to the Acroform' using the "Organize Pages" tool on the Acrobat desktop, while templates are present and functioning correctly, will continue to generate this error? I see Try67's fix below (amazing as usual!) but just seeking some education. Thanks in advance!
Copy link to clipboard
Copied
There are no Templates in the file, so the templates property returns null. You need to account for that in your code, like this:
if (this.templates!=null) {
for (var i = 0; i < this.templates.length; i++) {
this.templates[i].hidden = true;
}
}
Copy link to clipboard
Copied
Hi Try67! Yeah, it's perplexing because there are two functioning templates? Thank you Try67 for helping me! Very grateful for all you do here!! Thank you!!!
Copy link to clipboard
Copied
Where does you use the scripts?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more