Copy link to clipboard
Copied
I have been through the forum and this make sense to me but can't see to get this to work. I have this set up on click to run script. Please help.
var title = this.getField ("ButtonToHide");
if (this.getField("info_Company Name").value == "MyCompany")
{ title.display = display.visible; }
else
{ title.display = display.hidden; }
Don't know why this was the issue but var title was the problem. I renamed it and it works great.
var HideButton = this.getField ("ButtonToHide");
if (this.getField("info_Company Name").value == "MyCompany")
{ HideButton.display = display.visible; }
else
{ HideButton.display = display.hidden; }
Copy link to clipboard
Copied
Have you opened the Acrobat JavaScript console to see if there are any errors?
I expect you have a bad form field name where the name of the field does not exactly match the name being used in the script. Spelling, capitalization, and presence of special characters are all important.
Copy link to clipboard
Copied
Don't know why this was the issue but var title was the problem. I renamed it and it works great.
var HideButton = this.getField ("ButtonToHide");
if (this.getField("info_Company Name").value == "MyCompany")
{ HideButton.display = display.visible; }
else
{ HideButton.display = display.hidden; }
Copy link to clipboard
Copied
"title" is a built-in property name of the Document object, so you had a conflict when you tried to define a variable with that name.
Copy link to clipboard
Copied
I would expect that the word "title" is a keyword within Acrobat JavaScript, JavaScript, or you have defined it elsewhere in your form.
I have not problem using it a PDF form.