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

Check box then auto-populates text field.

New Here ,
Oct 05, 2022 Oct 05, 2022

Copy link to clipboard

Copied

Hi, 

 

Can someone help me with a script for the following problem.

 

When I check a box, I need "UNCLASSIFIED" to populate in another text fiield.

 

 

TOPICS
Create PDFs , Edit and convert PDFs

Views

1.3K

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 , Oct 05, 2022 Oct 05, 2022

As 'Mouse UP' action of that checkbox, add this script and change "Text field name" to your actual name of that text field:

this.getField("Text field name").value = event.target.value == "Off" ? "" : "UNCLASSIFIED";

Votes

Translate

Translate
Adobe Employee ,
Oct 05, 2022 Oct 05, 2022

Copy link to clipboard

Copied

Hi @Jo_Sh

 

Hope you are doing well. Per the description, I understand that you want to populate a text field with clicks on the check box.

 

I have found a thread that has a solution similar to your question. Please click the link: Solved: Populate checkbox with a button click - need help wi... 

 

Let me know if this helps.

 

-Souvik.

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 ,
Oct 05, 2022 Oct 05, 2022

Copy link to clipboard

Copied

As 'Mouse UP' action of that checkbox, add this script and change "Text field name" to your actual name of that text field:

this.getField("Text field name").value = event.target.value == "Off" ? "" : "UNCLASSIFIED";

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 ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

Thanbks so much! is there a way to lock out the other boxes once one is selected?  

 

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 ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

Yes, you can set them to read-only, but you will have to use script in each checkbox, and change names for each checkbox, let's say your checkboxes are named "Review Type.0-3" use something like this as Mouse UP action for first checkbox:

this.getField("Review Type.1").readonly = event.target.value == "Off" ? false : true;
this.getField("Review Type.2").readonly = event.target.value == "Off" ? false : true;
this.getField("Review Type.3").readonly = event.target.value == "Off" ? false : true;

 

Then in second checkbox just change field names like this:

this.getField("Review Type.0").readonly = event.target.value == "Off" ? false : true;
this.getField("Review Type.2").readonly = event.target.value == "Off" ? false : true;
this.getField("Review Type.3").readonly = event.target.value == "Off" ? false : true;

 

etc... for rest of the checkboxes.

 

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 ,
Nov 29, 2022 Nov 29, 2022

Copy link to clipboard

Copied

Does this work for Adobe Acrobat Pro?

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 ,
Nov 29, 2022 Nov 29, 2022

Copy link to clipboard

Copied

LATEST

Yes.

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