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

Grouping Text Fields & Check Boxes under Specific Category in PDF Form

Community Beginner ,
Oct 13, 2021 Oct 13, 2021

In my form, an individual will select a checkbox with the category, once selected it will open up the category section with additional information needed in text fields and checkboxes.  I have found how to hide and display the fields dependent on the category box being checked or not.  I am just having a really hard time with getting the category information fields/boxes to move up or down the document depending on the other category boxes checked - and keeping the same properties.  I tried the rect javascripting, but something is not working right.  

 

I was thinking I could group all the fields together under the Category Section name, then overwrite the hidden category sections/information fields when they are not visible.  Is this possible?

 

If needed, here is what I was currently using for my javascript on the MouseUP action:

var a = this.getField("Category2 checkbox"); 

var b = this.getField("Category1 Label").rect; 

var c = this.getField("Category1 Text Field1").rect; 

if (a.is Box Checked(0)) {

     this.getField("Category2 Label").display = display.visible

     this.getField("Category2 Text Field1").display = display.visible

}

else {

     this.getField("Category2 Label").display = display.hidden

     this.getField("Category2 Text Field1").display = display.hidden

}

var d = this.getField("Category1 checkbox"); 

if (((d.is BoxChecked(0)) && (a.isBoxChecked(0))) || (d.isBoxChecked(0))) {

     this.getField("Category2 Label").rect = [72,215,303,237];

     this.getField("Category2 Text Field1").rect = [71,191,201,213];

}

else if (a.isBoxChecked(0)) {

     this.getField("Category2 Label").rect = [b[0], b[3]+22, b[0]+231, b[3]];

     this.getField("Category2 Text Field1").rect = [c[0], c[3]+22, c[0]+130, c[3]];

}

else if (event.target.value == "Off") {

     this.getField("Category2 Label").rect = [72,215,303,237]; 

     this.getField("Category2 Text Field1").rect = [71,191,201,213];

}

 

 

TOPICS
Create PDFs , General troubleshooting , How to , JavaScript , PDF forms
2.8K
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 13, 2021 Oct 13, 2021

Instead of making it complicated for yourself,have you consider using layers to show/hide groups of fields?

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 Beginner ,
Oct 13, 2021 Oct 13, 2021

No, I have not.  I will do anything to make this less complicated!  How do  I use layers?  Is it a javascript?

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 13, 2021 Oct 13, 2021

Try watching this video, you will see how it works and if it's right for you.

https://www.youtube.com/watch?v=akF7wa0ggvQ 

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 Beginner ,
Oct 13, 2021 Oct 13, 2021

Nesa, I am on Adobe Acrobat Standard 2020 and I don't see where I can change or import layers.  Is this not available on the Standard version? 

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 13, 2021 Oct 13, 2021

On the left side of the screen right click and select layers:

Izrezak.PNG

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 Beginner ,
Oct 13, 2021 Oct 13, 2021

I did that, and this is what I see: 

Bobbi5CA8_0-1634143243363.png

 

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 13, 2021 Oct 13, 2021

Guess you probably need acrobat pro then.

Where did you stuck with rect scripts, can you share your file?

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 Beginner ,
Oct 14, 2021 Oct 14, 2021
LATEST

I think it might be a permissions issue that my IT needs to resolve.  I am waiting on them enable the permissions.  If that doesn't solve it, I will share my file with you.  Thank you! 

 

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