Is there a way to jump a checkbox/textbox if another is chosen
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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();
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thank you so very much for the assistance, it worked wonderfully.

