jQuery.FormValidator表单验证需要注意的问题

来源:互联网 发布:京东java面试题 编辑:程序博客网 时间:2024/05/16 12:46

jQuery.FormValidator表单验证需要注意的问题:在使用过程中,经常会出现某几项不显示的情况,在这个时候要特别注意,如果某表单后的像<tt id="Tipname"></tt>这个东西出现重复了,那么很可能导致多个验证无效。确保每个表单都是一个独立的ID,没有与其他的表单ID重名。

<script type="text/javascript">

  $(document).ready(function() {

$("#phone").SetValidateSettings({FormValidate : {
                        Empty : {Value : true},
                        Format : {Value : new RegExp("^(13|15)[0-9]{9}$"),
                        Message : "手机格式不正确"}},
                        Message : {
                                Text : {
                                    Success : "手机号码正确!",
                                    Error : "请输入手机号码",
                                    Focus : "输入中..."
                                },
                                MessageSpaceHolderID : "TipMobile"
                            }
                    });
        });

 页面<tt id="TipMobile"></tt>

0 0
原创粉丝点击