Skip to main content
New Participant
May 28, 2019
Question

How do I show text when clicking checkbox...? and more

  • May 28, 2019
  • 1 reply
  • 3057 views

Hey. I'm quite illiterate when it comes to Adobe Acrobat, but now I have to create a form.

First obstacle, how can I use a checkbox (i.e. tick checkbox action) to show text? (actually both just text but also text and form). Is there a way to do this? is it dynamic enough to do this or shall I just give up. Objective is to have one form for different audiences, and some information should be visible to those who tick the checkbox, for those who don't should only see limited text and forms. Maybe there is a really good tutorial for this, or video?

I have figured out how to create forms and that was easy enough. I also found some javascripts that may work?:

var f = this.getField("chk2");
if(f.isBoxChecked(0)){
  
this.getField("teamset2").display = display.visible;
  
this.getField("member2").display = display.visible;
}
else {
  
this.getField("teamset2").display = display.hidden;
  
this.getField("member2").display = display.hidden;

}

BUT - i don't even know how to name the text. I.e. the "getField" - i guess that is only for fields, checkboxes etc. But can it be used for plain text too?

Much grateful for help. and sorry for asking probably very stupid question. But would really like to make this work.

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
May 28, 2019

A script can't show or hide static text directly. It can show/hide form fields, as you've found out, so you could create a (read-only) text field or you can use a (read-only) field to cover up the static text and then hide that field when you want to make the text visible, and vice versa.

anetteqqqAuthor
New Participant
May 28, 2019

Thanks. Kind of suspected it. That means thinks like borders and lines (to make things look a bit neater) cannot be hidden/shown either then I assume...?

try67
Community Expert
Community Expert
May 28, 2019

Only by hiding them using other elements (namely, fields), as I've described before.