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

Check box then auto-populates text field.

New Here ,
Oct 05, 2022 Oct 05, 2022

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
2.3K
Translate
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
1 ACCEPTED SOLUTION
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";

View solution in original post

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

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.

Translate
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

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";

Translate
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

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

 

Translate
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

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.

 

Translate
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

Does this work for Adobe Acrobat Pro?

Translate
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
LATEST

Yes.

Translate
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