jQuery form check plugin
jQuery formcheck is a small plugin for validating form data. Try to submit "wrong" data using the forms below.
Altough this plugin has been used by me in some production sites without problems it has not been widely tested, please report any issue you find
here .
If you use this plugin and find it useful, or for suggestions and criticism please let me know by adding a comment
here .
Basic validation
Code:
$("#example1").formCheck({
fields:{
name:{empty:true,alpha:true,selector:'#example1 input[name="nick"]'},
email:{empty:true,email:true,selector:'#example1 input[name="email"]'},
tel:{empty:true,numeric:true,selector:'#example1 input[name="tel"]'}
},lang:'en'
});
Simple language support
Italian
Code:
$("#example_it").formCheck({
fields:{
name:{empty:true,alpha:true,selector:'#example_it input[name="nick"]'},
email:{empty:true,email:true,selector:'#example_it input[name="email"]'}
},lang:'it'
});
English
Code:
$("#example_en").formCheck({
fields:{
name:{empty:true,alpha:true,selector:'#example_it input[name="nick"]'},
email:{empty:true,email:true,selector:'#example_it input[name="email"]'}
},lang:'en'
});
Advanced multi language
This is a bit weird but will change in future versions
Code:
var lang='it';
var fields={name:{empty:true,alpha:true,selector:'#example2 input[name="nick"]'},
email:{empty:true,email:true,selector:'#example2 input[name="email"]'}};
$("#example2").formCheck({fields:fields,lang:lang});
$("#langsel").change(function(){
lang=$(this).val();
$("#example2").formCheck({fields:fields,lang:lang});
});
Select Language:
Italian
English