Comparing Fields and Customizing Error Messages with jQuery`s Validator Plug-in
(Page 1 of 4 )
Welcome to the final installment of the series that shows you how to check online forms with the Validator jQuery plug-in. Made up of seven tutorials, this series explores the most useful features that come packaged with this library, and shows you how to use them for performing strict validation on your own HTML forms.
Among the huge variety of plug-ins developed for the jQuery JavaScript library, there’s one that stands out from the rest because of its great functionality and flat learning curve. Of course, as you might have guessed, I’m talking about Validator, a compact and efficient component that allows you to validate web forms in the client by using all sorts of clever options. Thus, if you’re interested in learning how to incorporate this plug-in into your own web applications, then don’t hesitate anymore; start reading this group of articles now.
Now that you know what to expect from this series of articles, it’s time to review the topics that were discussed in the last episode. In that tutorial I explained how to utilize the “number” and “accept” options to validate numeric values and file extensions with extreme ease. In particular, the ability of the Validator plug-in to check file extensions can be really useful when developing a web application that will let users upload their files to the web server, assuming that this process will be always backed up by strong server-side validation.
Fortunately, the form checking options provided by Validator don’t stop here. It offers a few more that also deserve a closer look. In this last article of the series, I’m going to demonstrate how to use the plug-in to compare values between two fields of a web form. This can be helpful when implementing a classical password confirmation mechanism.
Additionally, I’m going to show you how to tweak the plug-in a bit to make it display custom error messages in a simple manner. So let’s move on and tackle the final part of this educational journey now!
Next: Review: validating numeric values and file extensions >>
More JavaScript Articles
More By Alejandro Gervasio