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.
You can do it like this:
if (this.getField("Text1").valueAsString!="") this.getField("Text1").fillColor = color.red;
Copy link to clipboard
Copied
Only if the text is inside a text field. If it's static text it can't be done.
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?
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.
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.
Copy link to clipboard
Copied
You can do it like this:
if (this.getField("Text1").valueAsString!="") this.getField("Text1").fillColor = color.red;
Copy link to clipboard
Copied
I gotta say you sure know your stuff. Worked perfectly. Nice work. Thanks for your help.
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?
Copy link to clipboard
Copied
You can... but it's extremely distracting visually. I suggest you don't.
Copy link to clipboard
Copied
Nonetheless, I'd still like to try it for myself.
Copy link to clipboard
Copied
Sure. Just change the textFont property from the regular font to the bold version, and back.
Copy link to clipboard
Copied
I think I understand. Thank you. Good teacher.