-
jquery.validate 以alert方式显示错误方法
- $.validator.setDefaults({
- submitHandler: function() { alert("submitted!");return false; }
- });
-
- $().ready(function() {
-
- $("#reg_form").validate({
- rules: {
-
- 'mem.username': {
- required: true,
- minlength: 5
- },
- 'mem.password': {
- required: true,
- minlength: 5
- }
- },
- messages: {
- 'mem.username': {
- required: "Please provide a password",
- minlength: "Your password must be at least 5 characters long"
- },
- 'mem.password': {
- required: "Please provide a password2",
- minlength: "Your password must be at least 5 characters long"
- }
- },
-
- showErrors: function(errorMap, errorList) {
- var msg = "";
- $.each( errorList, function(i,v){
- msg += (v.message+"
");
- });
- if(msg!="") alert(msg);
- },
-
- onfocusout: false
- });
- });
-
相关阅读:
在二进制与文本之间转换plist文件
iOS 音频分贝的计算
iOS 圆形水波浪效果实现
iOS画圆、画线
iOS IM开发准备工作(四)CocoaAsyncSocket的使用
iOS IM开发准备工作(三)乱说Socket
iOS IM开发准备工作(二)protobuf-objc安装及使用
iOS IM开发准备工作(一)XML解析
iOS IM开发blog写作计划
西游记倒着看。。我从贴吧看来的
-
原文地址:https://www.cnblogs.com/Leo_wl/p/4184112.html
Copyright © 2020-2023
润新知