Skip to main content
Participant
February 20, 2024
Question

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

  • February 20, 2024
  • 1 reply
  • 1659 views

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.

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
February 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();
Participant
February 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. 

 

 

Nesa Nurani
Community Expert
Community Expert
February 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.