Skip to main content
Participant
May 30, 2024
Question

How to make a page show when a checkbox is ticked

  • May 30, 2024
  • 2 replies
  • 395 views

Hi, is there a way to make a page show on a two page PDF if a checkbox is ticked?

 

I want to ask a custoemr if they are required to pay VAT.

If they aren't required to we have a VAT exempt form as page 2. 

 

What are the steps to make it so that when they tick "yes" they are exempt from tax, the second page with the VAT exempt form shows? 

 

Thanks.

This topic has been closed for replies.

2 replies

PDF Automation Station
Community Expert
Community Expert
May 30, 2024
Nesa Nurani
Community Expert
Community Expert
May 30, 2024

You can't hide a page, but you can delete it.

To make it work, you need to create a template from second page:

Select 'Organize pages' tool, select second page (the one you wish to show/delete), on the toolbar select 'More' then 'Page templates' give it a name, like: Tax 

then uncheck the little checkbox next to the name of the template to make it hidden.

Close Organize pages tool, and as 'Mouse UP' action of checkbox, use this:

if(event.target.value != "Off"){
this.getTemplate("Tax").spawn(event.target.page+1, false, false);
this.pageNum = event.target.page+1;//delete this line if you don't want to jump to template page when spawned.
}
else
this.deletePages(event.target.page+1);

If you need to rename fields on a spawned page, change first 'false' to 'true'.