Highlight text when check box ticked

New Here ,
Feb 12, 2020

Copy link to clipboard

Copied

I have a PDF which has a number of check boxes.

 

I want to be able to either highlight the text next to a check box when the box is selected or bold the text.

 

Example below.

 

Anyone done something similar?

 

Tickbox Highlight.png

TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

287

Likes

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

Highlight text when check box ticked

New Here ,
Feb 12, 2020

Copy link to clipboard

Copied

I have a PDF which has a number of check boxes.

 

I want to be able to either highlight the text next to a check box when the box is selected or bold the text.

 

Example below.

 

Anyone done something similar?

 

Tickbox Highlight.png

TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

288

Likes

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
Feb 12, 2020 0
Adobe Community Professional ,
Feb 12, 2020

Copy link to clipboard

Copied

You've got a few different options for doing this.

1)  Use the Highlight annotation to add highlights to all the text that needs to be shown as highlighted. The use a script on the MouseUp event of hte checkbox to toggle the "hidden" property of the associated annotation 

2) Replace text next to checkbox with a readonly text field. Then use the MouseUp script to change the font and/or textbox properties.

3) Replace text next to checkbox with a Text Markup Annotation. Use same MouseUp methodology.

 

 

 

Likes

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
Reply
Loading...
Feb 12, 2020 0
New Here ,
Feb 13, 2020

Copy link to clipboard

Copied

Thanks for your response.

 

I've still had no luck l'm afraid.

 

Do I need to apply the logic to the check box or the text field?

 

I've tried various scripts but still having no success.

 

Do you have any examples?

Likes

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
Reply
Loading...
Feb 13, 2020 0
Adobe Community Professional ,
Feb 13, 2020

Copy link to clipboard

Copied

Yes,  you'll need to create a custom script for the checkbox. And a text field is the easiest thing to use. We'll change the background color to make the highlight.

So lets say the text box is named "Line1Text" and the checkbox is "Line1Check"

 

Put this on the MouseUp of the checkbox

 

if(event.target.value != "Off)

    this.getField("Line1Text").fillColor = color.yellow;

else

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

 

 

Likes

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
Reply
Loading...
Feb 13, 2020 0