jQuery的Validate插件

2021-07-14 05:05

阅读:393

标签:required   target   function   span   ref   异步   www   logs   ddr   

http://www.runoob.com/jquery/jquery-plugin-validate.html

 

项目中的::

   $(function () {
        $(‘#createDepartment‘).validator({// jsvalidator框架
            rules: {
                remote: function (element) {//远程异步加载
                    return $.ajax({
                        url: /*[[@{/portal/human/department/valid-department-name.act}]]*/ "#",
                        type: ‘post‘,
                        data: {
                            "departmentname": function () {
                                return $(‘#name‘).val();
                            }
                        },
                        dataType: ‘json‘
                    });
                }
            },
            fields: {
                "superior.id": "required;superior.id;",
                "name": "required;name;remote;",
                "phone": "required;phone;",
                "address": "required;address;",
                "type": "required;type;"
            }
        });
    });

 

jQuery的Validate插件

标签:required   target   function   span   ref   异步   www   logs   ddr   

原文地址:http://www.cnblogs.com/yangjian-java/p/7076564.html


评论


亲,登录后才可以留言!