JavaScript
  Home arrow JavaScript arrow Checking Numbers and File Extensions with ...
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 
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? 
JAVASCRIPT

Checking Numbers and File Extensions with jQuery`s Validator Plug-in
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-11-09

    Table of Contents:
  • Checking Numbers and File Extensions with jQuery`s Validator Plug-in
  • Review: the digits and dates options
  • The number option
  • The accept argument

  • 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


    Checking Numbers and File Extensions with jQuery`s Validator Plug-in


    (Page 1 of 4 )

    In this sixth part of a seven-part series on the jQuery framework's Validator plug-in, I discuss the use of the “number” and “accept” options. They allow you to validate both numeric data and file extensions in online forms with remarkable ease.

    As you might have heard, the popular jQuery JavaScript library has a growing number of plug-ins that contribute to extending its functionality. Among these numerous pluggable components, there’s one that lets you perform powerful client-side validation on web forms with remarkable ease and without having to deal with complex JavaScript APIs at all.

    I'm talking about the Validator plug-in, a solid piece of software written by Jörn Zaefferer that allows you to check data collected through HTML forms in all sorts of smart ways, ranging from validating empty strings, numbers and dates, to verifying email addresses and well-formatted URLs.

    Thus, if you’re interested in learning how to put this useful validation library to work for you, then read this series of articles. In it you’ll find an approachable guide that will show you how to take advantage of the most useful features that come with the Validator plug-in.

    Having outlined the main goal of this group of tutorials, it’s time to refresh the topics that were covered in the last article. It explained how to use the “digits” and “date” options provided by the plug-in to check for numeric values and well-formatted dates. Actually, checking to see if data entered in a web form satisfy these conditions is only a matter of calling the already familiar “validate()” method of the plug-in with one of the arguments mentioned above. It’s that easy, really.

    But if all of these neat validation capabilities aren’t good enough for you, let me tell you that the Validator library still has a few other handy options that permit you to check numbers and file extensions in a straightforward fashion. Obviously, this last one is particularly useful when performing file uploads via HTTP, so in this sixth chapter of the series I’m going to demonstrate how to use it in concrete cases, in addition to explaining how to validate simple numbers.

    Therefore, it’s time to continue exploring the neat data checking abilities of the Validator plug-in. Let’s do it right now!

    More JavaScript Articles
    More By Alejandro Gervasio


       · This part of the series shows how to use the Validator jQuery plug-in for checking...
     

    JAVASCRIPT ARTICLES

    - Toggling CSS Properties with the GX JavaScri...
    - Cancel, Queue and Pause Animations with the ...
    - Producing Elastic Effects with the GX JavaSc...
    - Moving Divs Diagonally with the GX JavaScrip...
    - Moving Elements Vertically and Horizontally ...
    - Making Bouncing Effects in Parallel with the...
    - Creating Bouncing Effects with the GX JavaSc...
    - Manipulating Background Colors with the GX J...
    - The GX JS Animation Framework
    - Debug Ajax-Generated Tags in Firefox
    - Building a Page Controller with the jQuery Q...
    - Paginating Database Records with the jQuery ...
    - Paginating Images with the jQuery Quick Pagi...
    - Hiding the Page Counter with the jQuery Quic...
    - Introducing the Quick Pagination jQuery Plug...







    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 12 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek