Home arrow HTML arrow Page 4 - HTML Form Verification and ACP
HTML

HTML Form Verification and ACP


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.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
August 18, 2009
TABLE OF CONTENTS:
  1. · HTML Form Verification and ACP
  2. · The Code
  3. · The verifPage Variable
  4. · The verify() Function
  5. · Summary of the Document Phase of Chrys’s Approach to ACP

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
HTML Form Verification and ACP - The verify() Function
(Page 4 of 5 )

The aim of this function is to produce the Verification Page. This is the function:


function verify()

{

firstValue = document.getElementById('IP1').value;

secondValue = document.getElementById('IP2').value;

thirdValue = document.getElementById('IP3').value;


verifPageRef = document.open();

verifPageRef.write(verifPage);

verifPageRef.close();


verifPageRef.getElementById('S1').innerHTML = firstValue;

verifPageRef.getElementById('S2').innerHTML = secondValue;

verifPageRef.getElementById('S3').innerHTML = thirdValue;

}


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.


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials