Happy.js是一个轻量级的jQuery表单验证插件。
支持的浏览器IE6,8(and8incompat.mode,whichissupposedtobelike7)
FF3.6
Chrome7
Safari5
示例代码:
$('#awesomeForm').isHappy({ fields: { // reference the field you're talking about, probably by `id` // but you could certainly do $('[name=name]') as well. '#yourName': { required: true, message: 'Might we inquire your name' }, '#email': { required: true, message: 'How are we to reach you sans email??', test: happy.email // this can be *any* function that returns true or false } } });
评论