HTML form verification is a good candidate for Active Client Pages (ACP). After a user has filled in an HTML form, you may want to present a new page to him showing all of the information he has typed in the form. This new page is the verification page. In this article I show you how to use the technology of Active Client Pages to produce the verification page at the client, not from the server as the present state of the art depicts.
The first three statements copy the values of the Input Text elements into the three variables. The fourth statement opens an output stream for writing and returns a reference to this output stream. The fifth statement uses this reference to write data into the output stream. The value of the verifPage string variable is written into the output stream. The value of this variable consists of all the HTML elements of the verification page.
The sixth statement closes the output stream, and by so doing, effectively opens the verification page. The three statements that follow copy the values of the Input Text elements of the Form’s page, which are now in variables, to the respective Input Text elements in the verification page.
You may now ask, “What is the use of the first three statements? Why is the seventh statement not 'verifPageRef.getElementById('S1').innerHTML = document.getElementById('IP1').value;' ?"
Well, all I have to say here is that I tried the last three statements like this, and they did not work.
Definition of Active Client Pages
Active Client Pages is defined as the production of HTML pages at the client computer by the browser using web technology.
Some data or information for the HTML pages reside on the server. You need a client script language, such as JavaScript, to produce the HTML pages at the client. I use JavaScript in many of my articles.