【FAQ】表单校验的方式
来源:互联网 发布:svn linux 编辑:程序博客网 时间:2024/06/06 01:08
1、CSS校验
$.validator.addClassRules({memberPrice: {min: 0,decimal: {integer: 12,fraction: ${setting.priceScale}}},productImageFile: {required: true,extension: "${setting.uploadImageExtension}"},productImageOrder: {digits: true}});
2、name校验
// 表单验证$inputForm.validate({rules: {productCategoryId: "required",name: "required",sn: {pattern: /^[0-9a-zA-Z_-]+$/,remote: {url: "check_sn.jhtml?previousSn=${product.sn}",cache: false}},price: {required: true,min: 0,decimal: {integer: 12,fraction: ${setting.priceScale}}},cost: {min: 0,decimal: {integer: 12,fraction: ${setting.priceScale}}},marketPrice: {min: 0,decimal: {integer: 12,fraction: ${setting.priceScale}}},weight: "digits",stock: "digits",point: "digits"},messages: {sn: {pattern: "${message("admin.validate.illegal")}",remote: "${message("admin.validate.exist")}"}},submitHandler: function(form) {if ($specificationIds.filter(":checked").size() > 0 && $specificationProductTable.find("tr:gt(1)").size() == 0) {$.message("warn", "${message("admin.product.specificationProductRequired")}");return false;} else {var isRepeats = false;var parameters = new Array();$specificationProductTable.find("tr:gt(1)").each(function() {var parameter = $(this).find("select").serialize();if ($.inArray(parameter, parameters) >= 0) {$.message("warn", "${message("admin.product.specificationValueRepeat")}");isRepeats = true;return false;} else {parameters.push(parameter);}});if (!isRepeats) {$specificationProductTable.find("tr:eq(1)").find("select").prop("disabled", true);addCookie("previousProductCategoryId", $productCategoryId.val(), {expires: 24 * 60 * 60});form.submit();}}}});
0 0
- 【FAQ】表单校验的方式
- Jquery的框架 easyui 的表单校验的基本方式
- struts2学习之表单校验的两种方式
- Struts2的表单校验
- DOM(三)-09-(示例-表单校验-表单提交的两种方式)
- ASP之表单方式校验数据
- ASP之表单方式校验数据[续]
- Struts2 表单校验(2种方式)
- 表单递交前的校验
- Ajax自动校验的表单
- 映射表单校验的问题
- 统一的表单校验功能
- 表单中数据的校验
- Struts2的表单输入校验
- layui 表单标签的校验
- jQuery的validate表单校验
- XML的校验方式
- Struts1的校验方式
- 设置rman 实现归档备份在两个不同的目录
- JAVA中获取当前系统时间
- php yii框架web项目连接数据库以及crud操作
- BIRT学习日志之一(与项目集成)
- 提高C#编程水平的50个要点 1.总是用属性 (Property) 来代替可访问的数据成员 2.在 readonly 和 const 之间,优先使用 readonly 3.在 as 和 强制类型转换之
- 【FAQ】表单校验的方式
- Java项目中读取properties文件
- 解决redhat自带yum不能用的问题
- UVaOJ_10066 - The Twin Towers
- 把屋好这九点数据库设计原则提升mysql数据库性能
- IOS URL 转义方法
- ubuntu 12.04 android编译环境配置
- jQuery中$符号冲突问题
- 今天