Active Client Pages: Simple Document Phase Example Continued
In this sixth part of a twelve-part series on Active Client Pages (ACP), we complete the simple example that illustrates the Document phase of Chrys’s Approach. You need good knowledge of HTML, JavaScript and Perl to understand this part of the series.
Active Client Pages: Simple Document Phase Example Continued - The Code Segments (Page 2 of 4 )
We start with the code segment for the HTML elements.
The HTML Elements Code Segments
This is the code for the HTML elements:
<table id="S2" style="display:none">
<tr><td></td></tr>
<tr><td></td></tr>
</table>
This is the second page. <br />
First Name: <input type="text" id="I21"><br />
Last Name: <input type="text" id="I22"><br />
<button type="button" onclick="loadThirdPage()">Load Third Page</button>
The first thing you have is the store. This is an HTML table element. We mentioned it in the previous part of the series. The value of its display property is “none”; so it is not seen in the second page and it does not occupy any space in the second page. The cells of this table are filled by the JavaScript in the master page. The contents are taken from the contents (variables) of the store in the master page. So you have the notion of a moving store.
After the store table, you have text, which says that you are at the second page. This is followed by the line break element. Next you have a label and an Input Text element. This Input Text element has an ID. This ID is used by the JavaScript in the master page to write the first name as a value to the Input Text element.
Next you have the line break element and another Input Text element. This other Input Text element also has an ID. This ID is used by the JavaScript in the master page to write the last name as a value to the Input Text element. Next you have a button. When this button is clicked, the loadThirdPage() function in the JavaScript below in the page (see later) is called.