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

rollover button to highlight other fields?

Participant ,
Dec 22, 2017 Dec 22, 2017

Copy link to clipboard

Copied

I have created a spread sheet in acrobat. What I'd like to do is have a rollover (button) at the Item slot and when I move the cursor over it, it would trigger the fill color of the other text fields in that row to show. And, when I move the cursor off the button that particular row would go back to transparent (or white). I'd like to do the same thing with the text. It would just make reading the amounts in the spread sheet easier. Can this be done in a anti-complicated why because I'm learning javascripting. Can someone out there help me get this done? Thanks, guys.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

416

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

correct answers 1 Correct answer

Community Expert , Dec 22, 2017 Dec 22, 2017

You can do it like this:

if (this.getField("Text1").valueAsString!="") this.getField("Text1").fillColor = color.red;

Votes

Translate

Translate
Community Expert ,
Dec 22, 2017 Dec 22, 2017

Copy link to clipboard

Copied

Only if the text is inside a text field. If it's static text it can't be done.

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
Participant ,
Dec 22, 2017 Dec 22, 2017

Copy link to clipboard

Copied

I just want to make the row show the same color. The Item slot is a text field, all the fields are text fields. I just thought to add a button over the Item slot because that text field is readonly so the text in that field can't be changed.

So, are you saying that it can't be done to the other text fields in that particular row? Only the one text field? Any ideas to get this done?

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 ,
Dec 22, 2017 Dec 22, 2017

Copy link to clipboard

Copied

No, that's not what I said. I said it can't be done for static text. If your text is in fields (one or more) then it's possible.

As the Mouse Enter script of your button you can enter something like this:

this.getField("Text1").fillColor = color.red;

this.getField("Text2").fillColor = color.red;

this.getField("Text3").fillColor = color.red;

And as the Mouse Exit script enter this:

this.getField("Text1").fillColor = color.transparent;

this.getField("Text2").fillColor = color.transparent;

this.getField("Text3").fillColor = color.transparent;

Of course, adjust the field names and colors.

Also, if you want to change the text color just replace "fillColor" with "textColor" in the code above.

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
Participant ,
Dec 22, 2017 Dec 22, 2017

Copy link to clipboard

Copied

Ohhhhh, I see. That's what I was looking to do. But, what can I do if the text field, at times, would be blank? Is there a way to Not change that field's fill and text color? Only when populated.

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 ,
Dec 22, 2017 Dec 22, 2017

Copy link to clipboard

Copied

You can do it like this:

if (this.getField("Text1").valueAsString!="") this.getField("Text1").fillColor = color.red;

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
Participant ,
Dec 22, 2017 Dec 22, 2017

Copy link to clipboard

Copied

I gotta say you sure know your stuff. Worked perfectly. Nice work. Thanks for your help.

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
Participant ,
Jan 02, 2018 Jan 02, 2018

Copy link to clipboard

Copied

Thanks for helping me with my last issue. Can I ask another question regarding this issue? Is it possible to make the text go bold when I rollover (enter) the text field then go back to regular text when I exit the text field?

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 ,
Jan 02, 2018 Jan 02, 2018

Copy link to clipboard

Copied

You can... but it's extremely distracting visually. I suggest you don't.

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
Participant ,
Jan 02, 2018 Jan 02, 2018

Copy link to clipboard

Copied

Nonetheless, I'd still like to try it for myself.

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 ,
Jan 02, 2018 Jan 02, 2018

Copy link to clipboard

Copied

Sure. Just change the textFont property from the regular font to the bold version, and back.

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
Participant ,
Jan 02, 2018 Jan 02, 2018

Copy link to clipboard

Copied

LATEST

I think I understand. Thank you. Good teacher.

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