Button appearing above text on a higher layer

Explorer ,
Feb 09, 2021 Feb 09, 2021

Copy link to clipboard

Copied

I'm working on a script builder and my client wants sections to be "highlighted" if the checkbox or radio box next to them is selected. I figured the easiest way to do this was to draw boxes on a layer that I pulled underneath the main layer in InDesign (and is still ordered this way when exported to Acrobat). I made the boxes into buttons that are set to hidden until triggered and I used a script to check the event value of the checkbox and then turn on the hidden button corresponding to the question. However, this forces the highlight box to display OVER the text of the question (but under any additional fields within the question).

kateb89895260_0-1612917053119.png

The script I'm using is as follows:

if (event.target.value != "Off") {
// box is checked
this.getField("TransformQ1").display = display.visible ;
} else {
// box is unchecked
this.getField("TransformQ1").display = display.hidden ;
}

Thank you for any help you can offer me! I can change the design (this is not the styled version) to make it into something that shows in the margin, but I'm perplexed as to why something on a lower layer would cover text on a higher layer.

TOPICS
JavaScript, PDF forms

Views

71

Likes

translate

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

Most Valuable Participant , Feb 10, 2021 Feb 10, 2021
What you're doing is problematic. As you might have seen, you can't determine the z-order of fields. They why they interact with other overlapping fields is arbitrary, so it should be avoided. Fields will always appear on top of static content (like text), but you can set their fill color to be transparent and then the underlying content will show through. I would advise using some other means of highlighting the text, or at least making sure you don't have any overlapping fields if you choose t...

Likes

translate

Translate

Translate
Most Valuable Participant ,
Feb 10, 2021 Feb 10, 2021

Copy link to clipboard

Copied

What you're doing is problematic. As you might have seen, you can't determine the z-order of fields. They why they interact with other overlapping fields is arbitrary, so it should be avoided. Fields will always appear on top of static content (like text), but you can set their fill color to be transparent and then the underlying content will show through.

I would advise using some other means of highlighting the text, or at least making sure you don't have any overlapping fields if you choose to do it this way.

Likes

translate

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 ,
Feb 10, 2021 Feb 10, 2021

Copy link to clipboard

Copied

I'm always prepared for "this isn't doable" to be an answer, so I appreciate your reply! I might pivot to having bars or some other element next to the questions that are revealed instead of a thing that goes under the text. My client was amenable to this as a solution when I updated her yesterday, and it might feel less busy anyway.

 

Appreciate all of your help on this project, I'm newer to Javascript and trying more complex things with forms, but SO stoked to learn more. I purchased one reference book already, would love to know if you have any favorites!

Likes

translate

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
Adobe Community Professional ,
Feb 10, 2021 Feb 10, 2021

Copy link to clipboard

Copied

See this sample file, it use invisible fields to show/hide Highlight comments (click lines 5.1.1 or 5.1.3):

https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:20e3aad5-e8e4-403c-96cb-62f6daf8ea1a

 

The making-off is in this topic, you can copy-paste this URL in Google Translate:

https://abracadabrapdf.net/forum/index.php/topic,4142.0.html

Likes

translate

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 ,
Feb 10, 2021 Feb 10, 2021

Copy link to clipboard

Copied

Thank you for your response! Because most of the questions are multiple lines (and someone else is generating the design of this document in InDesign, not me), I'm a little concerned about this approach, but it's good to know that a highlight aspect can be controlled in a text box in the future!

Likes

translate

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