HTML
  Home arrow HTML arrow Page 4 - Good Form, Jack
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Good Form, Jack
By: Justin Cook
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 18
    2004-05-12

    Table of Contents:
  • Good Form, Jack
  • You Gotta Have Class
  • Getting a Little Fancy
  • Prevent Annoying Error Messages
  • Give Them a True GUI

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Good Form, Jack - Prevent Annoying Error Messages


    (Page 4 of 5 )

    You and I spend a good deal of time ensuring that people have entered the proper data types into the fields of a form. In fact, we even think of pleasant error messages, such as: “Excuse me Sir/Madam, you seem to have entered an incorrect date. Please be so kind as to enter the date in this format...” You see, we know that we need the date to be entered as DD/MM/YYYY, and we've prevented any programming errors by telling them so politely. But it will still be bothersome for the user to now go back, and change the field from "tomorrow" to the proper format.

    So how do we ensure that they're typing in data as we need it, before they even try to submit the form? Well, if you want, you could always just stand behind them and watch over their shoulder, even slap their hands if they mistype. You can call me crazy, but I'd much prefer a programmatic solution.

    In the case of date fields, it's very simple to ensure proper input. You just don't let them type anything in! It's that simple, you just add the readonly attribute to the input field. Of course they need some method to enter the date, which we provide ever so graciously with a JavaScript calendar. The reason for this is that you can configure in your code exactly how you want the date to be entered, and the calendar will consistently comply. Instead of wasting time creating your own calendar, you can download this slick tool: http://www.softcomplex.com/products/tigra_calendar/

    Another area you would want to monitor input is with number fields. Whether currency, phone numbers, whatever, all you want in that field are the integers between 0-9, and maybe a period. You can find a quick tool to limit the input to integers here: http://www.devarticles.com/c/a/JavaScript/Universal-Form-Validation/3/

    More HTML Articles
    More By Justin Cook


     

    HTML ARTICLES

    - Using a 3D HTML Table as a Recordset
    - Building a 3D HTML Table
    - Maximizing and Restoring HTML Images: Layer ...
    - Completing Construction of a Database Form w...
    - Maximizing and Restoring Images in a Tabular...
    - Building the Recordset for an HTML Database ...
    - Laying Out a Database Form with HTML
    - Tabular Database Form Functions with HTML
    - Tabular Database Forms with HTML
    - Using the Find Functions for HTML Database F...
    - Sorting for Database Forms with HTML
    - Edit and Other Database Form Functions with ...
    - More Database Form Functions with HTML
    - Database Form Functions with HTML
    - Using the HTML Table Element as a Recordset






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT