Skip to main content
Known Participant
December 22, 2017
Answered

rollover button to highlight other fields?

  • December 22, 2017
  • 1 reply
  • 785 views

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.

This topic has been closed for replies.
Correct answer try67

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.


You can do it like this:

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

1 reply

try67
Community Expert
Community Expert
December 22, 2017

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

pdfUser1Author
Known Participant
December 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?

try67
Community Expert
Community Expert
December 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.