Remove & Spawned Pages
I have a 2 page form with buttons. 2 of the buttons have the ability to spawn a new page when selected. If both of these buttons are selected then the form go from the initial 2 pages to a total of 4. My question is that I have a clear form button that when pressed I want any and all spawned pages remove to reset the form to the original 2 pages. When I enter the script below it will remove one of the 2 pages, but not both. What am I missing?
if (numPages > 2) {
this.deletePages(2, this.numPages-2);
}
