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

rollover button to highlight other fields?

Participant ,
Dec 22, 2017 Dec 22, 2017

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
654
Translate
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;

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

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

Translate
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

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?

Translate
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

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.

Translate
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

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.

Translate
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

You can do it like this:

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

Translate
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

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

Translate
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

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?

Translate
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

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

Translate
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

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

Translate
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

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

Translate
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
LATEST

I think I understand. Thank you. Good teacher.

Translate
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