VM Form Validator is a JavaScript form validation script based on MooTools 1.3. It aims to provide simple, reliable validation for all form element types across all browsers in an unobtrusive manner. It is 100% styled by CSS and allows for custom validations and error messages. Error messages can be displayed above the form, above each input, or below each input. VMFormValidator should not be used as a replacement for server-side validation (using PHP, .NET, etc) because JavaScript can be disabled. You can find a full tutorial, the full API docs, and demos at the Virtuosi Media website. Also, be sure to check out the rest of our MooTools plugins.
Features
Full documentation is available either on our website or in the package download. Basic usage is as follows:
window.addEvent('domready', function(){ var form = new VMFormValidator('registration'); form.required('username', 'Please enter a username.'); //Custom error form.alphanumeric('username'); //Default error form.range('username', 4, 10) //Default error form.required('password', 'Please enter a password.'); //Custom error form.noMatches('password', 'username', 'The password and username cannot be the same.'); //Custom Error form.password('password'); //Default error form.required('confirmPassword'); //Default error form.matches('confirmPassword', 'password', 'Passwords must match.'); //Custom error form.required('email'); //Default error form.email('email'); //Default error });
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus