Home arrow HTML arrow Page 3 - 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 verifPage Variable
(Page 3 of 5 )

This is the declaration and assignment of the variable:


verifPage = "<?xml version="1.0" encoding="UTF-8"?>"

+ "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">"

+ "<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">"

+ "<head>"

+ "</head>"

+ "<body>"

+ "Below is what you have typed. If that is OK, Click Send. <br /><br />"

+ "<span style="width:125px">First Input Text:</span><span id="S1"></span><br />"

+ "<span style="width:125px">Second Input Text:</span><span id="S2"></span><br />"

+ "<span style="width:125px">Third Input Text:</span><span id="S3"></span><br />"

+ "<form action="http://somesite.com/cgi-bin" method="post">"

+ "<INPUT id="IP1" type="text" style="display:none">"

+ "<INPUT id="IP2" type="text" style="display:none">"

+ "<INPUT id="IP3" type="text" style="display:none">"

+ "<button type="submit">Send</button>"

+ "</form>"

+ "</body>"

+ "</html>";"en">";



As you can see, the value of the variable is a string. The string is made up of the HTML elements of the verification page. All of the entities in the string have been escaped.

If you extract the HTML elements from the above string, you will have the following:


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

</head>

<body>

Below is what you have typed. If that is OK, Click Send. <br />

<br />

<span style="width:125px">First Input Text:</span><span id="S1"></span><br />

<span style="width:125px">Second Input Text:</span><span id="S2"></span><br />

<span style="width:125px">Third Input Text:</span><span id="S3"></span><br />

<form action="http://somesite.com/cgi-bin" method="post">

<INPUT id="IP1" type="text" style="display:none">

<INPUT id="IP2" type="text" style="display:none">

<INPUT id="IP3" type="text" style="display:none">

<button type="submit">Send</button>

</form>

</body>

</html>


The above is the code as it should be in the verification page. You should now be able to understand the code in the verification page. Let us now look at the verify() function.


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