Skip to main content
cmvarga5
Known Participant
June 21, 2023
Answered

Need to add condition to a checkbox that links to another page (PDF)

  • June 21, 2023
  • 1 reply
  • 843 views

I used the Acrobat generic function to link another page to a checkbox when clicked. However, if I need to uncheck that box, it will still take me to that page. Is there a way to code this so that if I deselect the checkbox, it stays put on that same page?

This topic has been closed for replies.
Correct answer Nesa Nurani

 

if (event.target.value != "Off"){
this.pageNum = 0;
}

 

Just replace 0 with the page number you wish to link, keep in mind pages start from 0, so first page is 0, second is 1...etc if you wish to link to page 5 replace 0 with 4.

This will work if that page is in the same file (not another file).

1 reply

Nesa Nurani
Community Expert
Community Expert
June 21, 2023

Yes, use script only if checkbox is checked.

if (event.target.value != "Off"){
//put your script here
}
try67
Community Expert
Community Expert
June 22, 2023

But linking to a specific page of another file using a script is very tricky, and requires embedding a script in the target file. I think they meant they used the built-in "Go to a page view" command, which can't be combined with a script. You either do it one way, or the other.

A better solution is not to use a check-box for this kind of thing, but a button.

cmvarga5
cmvarga5Author
Known Participant
June 22, 2023

Thank you! I think my request is a little too complicated. I might as well not link to any other page and have the applicant go over to that page themselves.