Copy link to clipboard
Copied
Iam using Adob DC Pro
i want to change tooltip of a text field dynamically. that is by script. I want change 100 field by loop.. please help
Copy link to clipboard
Copied
Need more info, what are conditions to change tooltip,change it to what,field names...etc?
Copy link to clipboard
Copied
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.,
Copy link to clipboard
Copied
What want you use as tooltip?
Copy link to clipboard
Copied
I tried following.. it did not wor
var target = this.getField('text1'); // pointing to field
target.value = " Hello World ";
target.tooltip = " New Tool Tip";
Copy link to clipboard
Copied
Check the Javascript console for errors.
Copy link to clipboard
Copied
do not throw any error
Copy link to clipboard
Copied
OK. The property tooltip doesn't exists. You must use userName.
Copy link to clipboard
Copied
i tied following,no change
target.userName = 'new tool';
Copy link to clipboard
Copied
i get following errot. i do't know how to interprer
getFieldRamp error S.50.0
getFieldRamp error S.50.1
getFieldRamp error S.50.2
getFieldRamp error S.50.3
getFieldRamp error res.50.prot
getFieldRamp error res.50.prot
getFieldRamp error Text.RampTime.Prot
Copy link to clipboard
Copied
What script does you use?
Copy link to clipboard
Copied
// ------ 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-----------------------//
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
thanks
I am running code from a Button field --> action --> Mouse Up -->execute code
Copy link to clipboard
Copied
Can you share a sample file?
Copy link to clipboard
Copied
I DELETED 3rd line....Now it is working.
Thank you sooooooooooooooooo much. soooo kind of you
With gratitde
var target = getField('text1'); // pointing to field
target.value = " Hello Worlda aa ";
// target.toolTip = " New Tool Tip by toolTip";
target.userName = 'new55 tool by username';
Copy link to clipboard
Copied
Whenever you have an inquiry like this, the first place to look is the Acrobat JavaScript Reference.
You'll find lots of information on programming forms in Acrobat here:
https://www.pdfscripting.com/public/PDF-Form-Scripting.cfm
Copy link to clipboard
Copied
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";
}
}