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

Working with checkboxes and code

New Here ,
Mar 13, 2018 Mar 13, 2018

Copy link to clipboard

Copied

Please help.  I am new to this and looking for a code to populate a text box with info from another text box by clicking a checkbox, and clearing the text box when the checkbox is unchecked.

Thank you in advance.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

346

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 , Mar 13, 2018 Mar 13, 2018

Questions similar to this one have been asked many times.  Here is a search on this forum:

https://forums.adobe.com/search.jspa?q=Checkbox+textbox

In general, you'll need to Place some JavaScript code into the MouseUp Action on the checkbox.

Something like this.

if(event.target.isBoxChecked(0))

{// Checkbox is checked

   this.getField("TargetField").value = this.getField("SourceField").value;

}

else

   this.getField("TargetField").value = "";

You'll need to change the field names to match your form

Votes

Translate

Translate
Community Expert ,
Mar 13, 2018 Mar 13, 2018

Copy link to clipboard

Copied

Questions similar to this one have been asked many times.  Here is a search on this forum:

https://forums.adobe.com/search.jspa?q=Checkbox+textbox

In general, you'll need to Place some JavaScript code into the MouseUp Action on the checkbox.

Something like this.

if(event.target.isBoxChecked(0))

{// Checkbox is checked

   this.getField("TargetField").value = this.getField("SourceField").value;

}

else

   this.getField("TargetField").value = "";

You'll need to change the field names to match your form

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Mar 13, 2018 Mar 13, 2018

Copy link to clipboard

Copied

LATEST

Thank you so much!  This is exactly what I needed!

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