首先在 Providers\AppServiceProvider.php 文件中自定义 手机号和身份证号验证 // AppServiceProvider.php 文件 <?php namespace App\Providers; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\DB; class AppServicePr
1.身份证号验证 var Common = { //身份证号验证 IsIdCardNo: function (IdCard) { var reg = /^\d{15}(\d{2}[0-9X])?$/i; if (!reg.test(IdCard)) { return false; } if (IdCard.length == 15) { var n = new Date(); var y = n.getFullYear(); if (parseInt("19" + IdCard.sub
1.身份证号码验证: var Common = { //身份证号验证 IsIdCardNo: function (IdCard) { var reg = /^\d{15}(\d{2}[0-9X])?$/i; if (!reg.test(IdCard)) { return false; } if (IdCard.length == 15) { var n = new Date(); var y = n.getFullYear(); if (parseInt("19" + IdCard.s
话不多说上代码 //身份证号合法性验证 //支持15位和18位身份证号 //支持地址编码.出生日期.校验位验证 function cidInfo(code) { var city={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江 ",31:"上海"
<script type="text/javascript"> //--身份证号码验证-支持新的带x身份证 function isIdCardNo(num) { var factorArr = new Array(7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2,1); var error; var varArray = new Array(); var intValue; var lngProduct = 0; var intCheckDigit;
/* 1.是否以某字符串结尾 endsWith(theStr,endStr) @param theStr:要判断的字符串 @param endStr:以此字符串结尾 @return boolean; */ function endsWith(theStr,endStr) { var theStrLength=theStr.length; var endStrLength=endStr.length; var theStrEnd=theStr.substring(theStrLength-endS