Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


script to change tooltip of textfield dynamically

Explorer ,
Jun 09, 2021 Jun 09, 2021

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

TOPICS
Comment review and collaborate PDF, Create PDFs, Edit and convert PDFs, How to, PDF forms

Views

1.3K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 09, 2021 Jun 09, 2021

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 09, 2021 Jun 09, 2021

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., 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 09, 2021 Jun 09, 2021

Copy link to clipboard

Copied

What want you use as tooltip?

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 09, 2021 Jun 09, 2021

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";

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

Check the Javascript console for errors.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

do not throw any error

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

OK. The property tooltip doesn't exists. You must use userName.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

i tied following,no change

 

target.userName = 'new tool';

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 10, 2021 Jun 10, 2021

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

What script does you use?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 10, 2021 Jun 10, 2021

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-----------------------//

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 10, 2021 Jun 10, 2021

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?

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

thanks

 

I am running code from a Button field --> action --> Mouse Up -->execute code

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

Can you share a sample file?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

LATEST

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';

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 09, 2021 Jun 09, 2021

Copy link to clipboard

Copied

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_Acro...

 

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 PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 10, 2021 Jun 10, 2021

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";
}

}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines