Skip to main content
This topic has been closed for replies.

3 replies

JR Boulay
Community Expert
June 10, 2021

Copy-paste this script in the JS Console, select all, then hit the Enter key:

 

for (var i = 0; i < this.numFields; i++) {

var oFld = this.getField(this.getNthFieldName(i));
if ((oFld.type == "text") && (/entername/.test(oFld.name))) {
oFld.userName = "New Tooltip text";
}

}

Acrobate du PDF, InDesigner et Photoshopographe
Thom Parker
Community Expert
June 9, 2021

Whenever you have an inquiry like this, the first place to look is the Acrobat JavaScript Reference.

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_AcroJS%2FField_properties.htm%23TOC_userNamebc-49&rhtocid=_6_1_8_31_1_48

 

You'll find lots of information on programming forms in Acrobat here:

https://www.pdfscripting.com/public/PDF-Form-Scripting.cfm

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Inspiring
June 9, 2021

Need more info, what are conditions to change tooltip,change it to what,field names...etc?

MY RajAuthor
Inspiring
June 10, 2021

No condition. I have many text field with similar name like (entername#1 upto entername#90, designation#1...). I want to change tooltop by script., 

try67
Community Expert
June 10, 2021

// ------ Tool Tip Change --- //

var target = getField('text1'); // pointing to field
target.value = " Hello World ";
target.toolTip = " New Tool Tip by toolTip";

target.userName = 'new tool by username';

//---------------End toopTip-----------------------//


Get rid of the third line, since there's no toolTip property, as you were already told...

From where are you running this code, and what is the exact output you're seeing?