jquery validation验证,错误提示放在input框的右边
来源:互联网 发布:比价软件哪个好 编辑:程序博客网 时间:2024/05/16 05:11
.formTitle{padding-left:38px;padding-right:11px;float:right;} .formValue{ width:230px; } label.error {float: right; position: relative; color: #ef392b; font-size: 12px; padding-top: 8px; margin-bottom: -28px; margin-right: 20px;}<form id="form1"> <table class="form"> <tbody><tr> <td class="formTitle">商户名称</td> <td class="formValue"> <div> <input id="Name" name="Name" type="text" class="form-control" placeholder="请输入商户名称"> </div> </td> <td class="formTitle">商户编号</td> <td class="formValue"> <input id="Encode" name="Encode" disabled="true" type="text" class="form-control"> </td> </tr> <tr> <td class="formTitle">地区</td> <td class="formValue"> <select id="province" name="province" style="width:110px" onchange="select_citys(this)"> </select><select id="city" name="city" style="width:110px"> <option id="cityf" value="">--请选择--</option></select> </td> <td class="formTitle">详细地址</td> <td class="formValue"> <input id="Address" name="Address" type="text" class="form-control" placeholder="请输入地址"> </td> </tr> <tr> <td class="formTitle">联系人</td> <td class="formValue"> <input id="Manager" name="Manager" type="text" class="form-control" placeholder="请输入联系人"> </td> <td class="formTitle">手机</td> <td class="formValue"> <input id="Mobilephone" name="Mobilephone" type="text" class="form-control" placeholder="请输入手机号"> </td> </tr> <tr> <td class="formTitle">联系电话</td> <td class="formValue"> <input id="Telephone" name="Telephone" type="text" class="form-control" placeholder="请输入电话"> </td> <td class="formTitle">微信</td> <td class="formValue"> <input id="Wechat" name="Wechat" type="text" class="form-control" placeholder="请输入微信号" > </td> </tr> <tr> <td class="formTitle">邮箱</td> <td class="formValue"> <input id="Email" name="Email" type="text" class="form-control" placeholder="请输入邮箱"> </td> <td class="formTitle">推荐码</td> <td class="formValue"> <input id="ReferralCode" name="ReferralCode" type="text" class="form-control" placeholder="请输入推荐码" > </td> </tr> <tr> <td class="formTitle">支付宝</td> <td class="formValue"> <input id="Alipay" name="Alipay" type="text" class="form-control" placeholder="请输入支付宝"> </td> </tr> <tr> <td class="formTitle" valign="top" style="padding-top: 5px;">备注</td> <td class="formValue" colspan="3"> <textarea id="Description" name="Description" class="form-control" style="height: 100px;"></textarea> </td> </tr> </tbody></table><div style="text-align: center"><button id="btn" class="btn btn-info" type="submit">保存</button></div> </form> //验证$("#form1").validate({ rules:{ Name:{ required:true, minlength:2,maxlength:18 }, Address:{ required:true }, Manager:{ required:true }, Mobilephone:{ required:true, isMobile:true }, Email:{ required: false, email: true }, ReferralCode:{ required: true, remote: {url: serverWeb+"sysDepartment/isExistReferralCode", //后台处理程序 type: "post", //数据发送方式 dataType: "json", //接受数据格式 data: { //要传递的数据 referralcode: function() { return $("#ReferralCode").val(); } } } }, Alipay:{ required: true } }, messages: { Name:{ required: "必填", minlength: "长度为2-18个字符", maxlength: "长度为2-18个字符" }, Address:{ required: "必填", }, Manager:{ required:"必填" }, Mobilephone:{ required:"必填", isMobile: "格式不正确" }, Email:{ email: "格式不正确" }, ReferralCode:{ required:"必填", remote: "推荐码不存在" }, Alipay:{ required: "必填", } }, errorPlacement: function(error, element) { //错误信息位置设置方法 error.prependTo(element.parent()); //这里的element是录入数据的对象 }, showErrors: function(errorMap, errorList) { this.defaultShowErrors(); for(var i = 0; i < errorList.length; i++) { $(errorList[i].element).one("blur", function() { $("label.error[for='" + (this.id ? this.id : this.name) + "']").remove(); }); } }, onkeyup:false,focusCleanup:false,submitHandler:function(form){if($("#province").val() == "" || $("#city").val() == ""){layer.msg("地址必须填");return false;}save();}});
阅读全文
0 0
- jquery validation验证,错误提示放在input框的右边
- 修改jquery-validation让你的验证提示更漂亮
- Struts2 Validation验证框架错误提示信息的显示位置
- JQuery-Validation插件,中文错误提示乱码的解决
- 清除jquery validation插件的上一次错误提示消息
- jQuery Validate设置错误的提示信息的位置都放在最后面:
- Silverlight的数据验证Input validation
- validate错误提示放在input后(即使带有单位)以及判断日期大小
- jquery input提示框
- JQuery验证插件validation的使用
- Jquery Validation表单验证插件的使用
- jQuery Validation 验证控件
- jQuery validation 分布验证
- 验证错误信息jquery validation
- 表单验证- jQuery+Validation
- 表单验证- jQuery+Validation
- 冒泡排序的方式实现一组数据偶数放在左边奇数放在右边
- jquery formValidator插件ajax验证,在内容不做修改的前提下提示错误的bug解决方法
- 小程序在数据绑定中取整
- elasticsearch6.x.x logstash6.x.x kibana6.x.x Filebeat6.x 配置及安装 CentOS7.3或更高
- css常用效果总结
- ELK部署笔记
- 【.Net码农】【淘宝API】淘宝API开发系列--读取实体类的属性的备注作为表头的应用
- jquery validation验证,错误提示放在input框的右边
- 导入数据库时报错1067 – Invalid default value for ‘字段名’
- npm本地安装与全局安装
- poj2068 Nim【博弈论】
- Scala_环境配置
- python不同的赋值方法
- ubuntu16.04使用EAP配置802.1x
- Spark性能调优:RDD的复用以及RDD持久化
- 蓝桥杯-微生物增殖