• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

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
Create PDFs , Edit and convert PDFs , How to , PDF forms

Views

3.1K

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?

Votes

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

Votes

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
Community Expert ,
Jun 09, 2021 Jun 09, 2021

Copy link to clipboard

Copied

What want you use as tooltip?

 

Votes

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

Votes

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
Community Expert ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

Check the Javascript console for errors.

Votes

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

Votes

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
Community Expert ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

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

Votes

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

Votes

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

Votes

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
Community Expert ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

What script does you use?

Votes

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

Votes

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
Community Expert ,
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?

 

Votes

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

Votes

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
Community Expert ,
Jun 10, 2021 Jun 10, 2021

Copy link to clipboard

Copied

Can you share a sample file?

Votes

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

Votes

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
Community Expert ,
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

Votes

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
Community Expert ,
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";
}

}

Votes

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