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

Is there a way to jump a checkbox/textbox if another is chosen

Community Beginner ,
Feb 20, 2024 Feb 20, 2024

I am very new to creating a PDF; I created a form and placed all the fields. I am trying to figure out how I can have a field skip if another field is chosen. 

If Yes is chosen, it will jump to the fillable field for the answer.

If No is chosen, it would jump the fillable field to the next question.

TOPICS
Create PDFs , Edit and convert PDFs , PDF , PDF forms
1.1K
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 ,
Feb 20, 2024 Feb 20, 2024

You can use setFocus() to set focus to another field, let's say field name is "Text1" as 'Mouse Up' action of "Yes" checkbox use this:

if(event.target.value !== "Off")
this.getField("Text1").setFocus();
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 ,
Feb 20, 2024 Feb 20, 2024

Hello, I am not sure how to do this. I am incredibly new to form creation. I am looking to have, if yes is checked, jump to the fill-in section. If no is checked, jump to the yes, on candles, etc. 

Katkasper56_0-1708448675438.pngexpand image

Katkasper56_1-1708448833263.pngexpand image

 

 

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 ,
Feb 20, 2024 Feb 20, 2024

I just used "Text1" as example, you don't need to change your field name to that, just replace "Text1" with your actual field name.

JavaScript is case-sensitive so setfocus() will not work, it needs to be setFocus().

To place script to correct place, select 'Prepare form' tool and right click on checkbox and select 'Properties' now select 'Action' tab, leave 'Select trigger' as 'Mouse Up' and for 'Select action' choose 'Run a Javascript' then click on 'Add' and put script in there.

If you still have trouble with this, share your file with us and I will help you place scripts.

tempsnip.pngexpand image

 

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 ,
Feb 22, 2024 Feb 22, 2024

Hi, I tried the script, and the line was accepted. However, it isn't letting me add any other lines.  Basically, I am attempting to have the "yes" checkboxes move to the written area, and the "no" checkboxes move to the next "Yes." Basically, I am trying to jump over the written area if No is checked. 

Right Now, the tab moves from "Yes to the written box to No, then the next Yes"

I hope this makes sense and I appreciate the help

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 ,
Feb 22, 2024 Feb 22, 2024

Use this in "Yes Movies" checkbox:

if(event.target.value !== "Off")
this.getField("Movies").setFocus();

 

Use this in "No Movies" checkbox:

if(event.target.value !== "Off")
this.getField("Yes Candles").setFocus();

 

Use same scripts for other checkboxes, just replace field names.

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 ,
Feb 25, 2024 Feb 25, 2024
LATEST

Thank you so very much for the assistance, it worked wonderfully.

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