Highlighted

Reference name of page

Avatar

Guest

08-12-2008

Hi,



Does anybody know how to reference the name of a page in JavaScript? I have a form with 10 pages and want to use the same code on each page to return that page's name.



Thanks for the help?

Ralph

Replies

Highlighted

pguerett

09-12-2008

Its not as simple as that. Remember that this is an XML stuctured form so it is hierarchical in nature. Here is the way that I woudl get all page names:<br /><br />// get all nodes from the root node.<br />var oNodes = form1.nodes<br />//cycle through each note<br />for (i=0;i<oNodes.length;i++){<br /> //create an object for each node that we find<br /> var childElement = oNodes.item(i);<br /> // Test to see if the node is a subform node (all Pages will be subforms)<br /> if (childElement.className == "subform"){<br /> //write the name of the subform node to the screen<br /> app.alert(childElement.name);<br /> } <br />}<br /><br />If you only want to get the name of the page that you are on you get use any object on the form, get the somExpression and parse away the bits that you do not need.