Skip to main content
johnnyZ
Inspiring
March 29, 2024
Answered

Custom formatting disappears ???

  • March 29, 2024
  • 2 replies
  • 1153 views

I have a telephone number field in a "fill-in" PDF file.

I'm using a Custom Format Script to create a multi-line Tool Tip.

this.getField("Preferred_Phone_Number").userName = "Enter Preferred Phone Number (10-Digits)\n(Ingrese el número de teléfono preferido)"; 

Then, in the same field, I go to the Format Tab and choose Select format category and choose Special, Phone Number.  Everything appears to be working, the multi-line tool tip and the phone number format. (123) 456-7890.

Now, if I need to modify the multi-line Tool Tip, the Java Script under Custom Format Script is gone?  I have to recreate the entire Java Script?  WHY?  Then I have to reselect the Special Phone Number format.  Am I doing something wrong?

Can't Adobe Acrobat remember 2 different formats?

BTW, running Adobe Acrobat Standard 2020.

 

This topic has been closed for replies.
Correct answer Thom Parker

You'll need an automation tool to do this. You can download one here.  

https://www.pdfscripting.com/public/Free_Acrobat_Automation_Tools.cfm

It works on standard the same as Reader. 

 

 

 

2 replies

Thom Parker
Community Expert
Community Expert
March 30, 2024

Yes, you are doing something wrong, actually more than one thing.  There can be only one format script, you cannot have both the custom script and the special formatting. Both are in fact scripts that occupy the same space. 

The tooltip script is not related to formatting so it can be placed somewhere else. For example the custom Validation Script would be perfect for this. 

 

However, the tooltip script is unnecessary. The tooltip only needs to be set once, not every single time the field is updated. So, run your tooltip script from the console window to set the tooltip once. Then save the file, and your done. 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
johnnyZ
johnnyZAuthor
Inspiring
March 31, 2024

Can you direct me as to how I get to the console window?

I'm running Adobe Acrobat Standard 2020.

I've watched educational videos on YouTube, and when he clicked on the Main Tools Tab, and scrolled to the very bottom, the video shows a JavaScript Tool where he clicked on open.

But, I don't have that JavaScript Tool Icon.

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
March 31, 2024

You'll need an automation tool to do this. You can download one here.  

https://www.pdfscripting.com/public/Free_Acrobat_Automation_Tools.cfm

It works on standard the same as Reader. 

 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Bernd Alheit
Community Expert
Community Expert
March 29, 2024

What script do you use under Custom Format Script?

johnnyZ
johnnyZAuthor
Inspiring
March 29, 2024

It was in my original post.  But here it is again.

this.getField("Preferred_Phone_Number").userName = "Enter Preferred Phone Number (10-Digits)\n(Ingrese el número de teléfono preferido)"; 
Nesa Nurani
Community Expert
Community Expert
March 29, 2024

EDIT: I misread your post. Why not set tool tip manually?