bootstrap正则表达式验证手机 座机 邮箱


$('#CusForm').bootstrapValidator({
        fields : {
            //验证手机
            'customer.mobile' : {          //input中的name 值
                validators:{
                    regexp: {
                        regexp: /^1\d{10}$/ ,
                        message: '请输入正确的11位手机号'
                    }
                    
                }
            },
            //验证座机
            'customer.phone' : {
                validators:{
                    regexp: {
                        regexp: /^$|(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$/ ,
                        message: '请输入正确座机电话'
                    }
                    
                }
            },
            //验证邮箱
            'customer.email' : {
                validators:{
                    regexp: {
                        regexp: /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/ ,
                        message: '请输入正确的邮箱地址'
                    }
                    
                }
            },
    
            
        }
    });

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM