Copy link to clipboard
Copied
I am currently working on a form with 7 checkboxes. If "Trust" is clicked then it spawns a new page. If the others are clicked then I want the spawned page to delete.
I have spawned a page with a text field called "Page text 2". I have added the following code to the other six checkbox buttons.
var v = this.getField("Check Box 1").value; if (v === "Partnership") { var f = this.getField("Page text 2").page; this.deletePages(f); }
Obviously changing the Value for the other 5 checkboxes.
It doesn't seem to be working.
I will be grateful for any help.
Steve
Copy link to clipboard
Copied
When you created template did you have two of those fields because it is considered as second field? It gets spawned with widget 1, so either update your template and use a new name or in your script add its widget to the field name like this: var f = this.getField("Page text 2.1").page;
Copy link to clipboard
Copied
There is no "Page text 2" field on spawned page.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
When you created template did you have two of those fields because it is considered as second field? It gets spawned with widget 1, so either update your template and use a new name or in your script add its widget to the field name like this: var f = this.getField("Page text 2.1").page;
Copy link to clipboard
Copied
Many thanks Nesa, working great now.