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

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

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.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 4
November 09, 2009
  1. · Checking Numbers and File Extensions with jQuery`s Validator Plug-in
  2. · Review: the digits and dates options
  3. · The number option
  4. · The accept argument

print this article

Checking Numbers and File Extensions with jQuery`s Validator Plug-in
(Page 1 of 4 )

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!

blog comments powered by Disqus

- Project Nashorn to Make Java, JavaScript Wor...
- JavaScript Virus Attacks Tumblr Blogs
- Google Releases Stable Dart Version, JavaScr...
- Khan Academy Unveils New JavaScript Learning...
- Accessing Nitro? There`s an App for That
- JQuery 2.0 Leaving Older IE Versions Behind
- Fastest JavaScript Engine Might Surprise You
- Microsoft Adjusting Chakra for IE 10
- Brendan Eich: We Don`t Need Google Native Cl...
- An Overview of JavaScript Statements
- An Overview of JavaScript Operators
- Overview of JavaScript Variables
- More of the Top jQuery Social Plugins
- The Top jQuery Social Plugins
- More of the Top jQuery Slider Plugins

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


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