• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

If checkbox is selected, text appears elsewhere on document in text box

New Here ,
Aug 23, 2024 Aug 23, 2024

Copy link to clipboard

Copied

Hello! I am very new to using javascript especially in Acrobat pro. I would like when a checkbox is selected, specific text appears in another text box. And if unselected, the text will disappear.

 

What is the simplest way to write that code?

Thank you so much for your help!

Views

107

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

Community Expert , Aug 23, 2024 Aug 23, 2024

Let's say your 'text box' is actually a text field and let's say it's named "Text1", use this as Mouse UP action  'Run a JavaScript':

var cText = "Put your text here";

this.getField("Text1").value = (event.target.value == "Off")? "" : cText;

Votes

Translate

Translate
Community Expert ,
Aug 23, 2024 Aug 23, 2024

Copy link to clipboard

Copied

sin the future, to find the best place to post your message, use the list here, https://community.adobe.com/

p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post (like this one has already been moved) if it helps you get responses.



<"moved from using the community">

Votes

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
New Here ,
Aug 24, 2024 Aug 24, 2024

Copy link to clipboard

Copied

Thank you so much for your assistance. I have never posted on a community board before and you helped get my question seen. 

Votes

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
Community Expert ,
Aug 23, 2024 Aug 23, 2024

Copy link to clipboard

Copied

Let's say your 'text box' is actually a text field and let's say it's named "Text1", use this as Mouse UP action  'Run a JavaScript':

var cText = "Put your text here";

this.getField("Text1").value = (event.target.value == "Off")? "" : cText;

Votes

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
New Here ,
Aug 24, 2024 Aug 24, 2024

Copy link to clipboard

Copied

OMG Nesa, Thank you so much!! It worked. I am so thankful to you. 😊

Votes

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
New Here ,
Aug 24, 2024 Aug 24, 2024

Copy link to clipboard

Copied

LATEST
OMG Thank you so much!! It worked. I am so thankful to you. 😊

Votes

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