Copy link to clipboard
Copied
How do I build a button that creates a new page with the same format but the data is blank? i.e. I used the JavaScript command "var.a=this.getTemplates("Second Page");a.spawn();" and it creates the new page, but it copies over all the data from that page into the new page....I want the new page to be blank (with the same formatting)...what do I need to change to the code?
Copy link to clipboard
Copied
You need to specify the bRename parameter of the spawn method as true, and then you need to reset all the fields on the newly created page. Either that or use a (hidden) Template page with empty fields and spawn the new pages from it.
Copy link to clipboard
Copied
Thanks! Do you have the bRename parameter of the spawn as true code? Thanks!
Copy link to clipboard
Copied
Correct.
Copy link to clipboard
Copied
What's the code? Mine doesn't work...
Copy link to clipboard
Copied
You have an error in your code: Remove the 3 from "num3Pages".
Copy link to clipboard
Copied
So I fixed the error in the code (removed the 3)...however, the add page keeps data from the earlier page...I'm trying to get the page to be blank...seems like bRename isn't working?
Copy link to clipboard
Copied
The spawn method doesn't clear the fields, even if they are renamed. You will need to do that yourself.