function validatenum(val){//验证整数 var patten = /^-?\d $/; return patten.test(val); } function validaterealnum(val){//验证实数 var patten = /^-?\d \.?\d*$/; return patten.test(val); } function validatenum(val){//验证小数,保留一位小数点 var patten = /^-?\d \.?\d{0,1}$/; return patten.test(val); } function validatefloat(val){//验证小数 var patten = /^-?(?:\d |\d{1,3}(?:,\d{3}) )(?:\.\d )?$/; return patten.test(val); } function validatenumorletter(val){//只能输入数字和字母 var patten = /^[a-za-z0-9] $/; return patten.test(val); } function validatecolor(val){//验证颜色 var patten = /^#[0-9a-fa-f]{6}$/; return patten.test(val); } function validate{ //验证url var patten = /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(%[\da-f]{2})|[!\$&'\*\ ,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(([a-z]|\d|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])*([a-z]|\d|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])))\.) (([a-z]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(([a-z]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])*([a-z]|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(%[\da-f]{2})|[!\$&'\*\ ,;=]|:|@) (\/(([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(%[\da-f]{2})|[!\$&'\*\ ,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(%[\da-f]{2})|[!\$&'\*\ ,;=]|:|@)|[\ue000-\uf8ff]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef])|(%[\da-f]{2})|[!\$&'\*\ ,;=]|:|@)|\/|\?)*)?$/i; return patten.test(val); } function validatenull(val){//验证空 return val.replace(/\s /g, "").length==0; } function validatedate(val){//验证时间2010-10-10 var patten = /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/; return patten.test(val); } function validatenumletterline(val){//只能输入数字、字母、下划线 var patten = /^[a-za-z0-9_]{1,}$/; return patten.test(val); }
xhtmt|
html5|
css|
html dom|
jquery|
json|
ajax|
less|
html|
bootstrap|
foundation|
angularjs|
ember.js|
typescript|
angularjs2|
react|
jquery ui|
jquery easyui|
node.js|
highcharts|
echarts|
vue.js|
coffeescript|
ext.js|
meteor|
sass|
omi|
markdown|
前端开发规范|
浏览器|
webpack|
javascript|
css3|
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....