I have a simple form with two pages one text field on each page. The first page has a button that adds another instance of it to the document. When the button is pressed another page is added but the focus stays on the same page.
I'm looking for the code syntax that will allow me to set focus to the newest(last) instance of the added page.
Assuming you're doing it by spawning a template you can derive the name of the field in the spawned page (it has a fixed structure, composing of the template name, the page number and the original field name) and then use the setFocus method to switch to it.