Java Script Delete Page
Hello I'm new to javascript. I'm pretty much googling everything so if I do not use the correct nomenclature, my apologies. I have a pdf document with a check box. I would like this check box to spawn a "medical" form and make two fields hidden and when they uncheck the box, I would like for the "medical" form to be deleted and the two fields to be visible. So far, I have been able to write a javascript where it does everything except for deleting the "medical" page. No matter how I try to write the script, I can't get it to delete the "medical" form. Below is my script. Can anyone help?
var a = this.getField("Please Answer");
var b = this.getField("Questions");
var c = this.getTemplate("Medical")
if(event.target.value == "Yes"){
a.display = display.hidden;
b.display = display.hidden;
c.spawn(event.target.page+5, false, false)
}
else if(event.target.value == "Off"){
a.display = display.visible;
b.display = display.visible;
c.deletePage({nStart: 6})
}
