jQuery使用正则判断是否含有非法字符
时间:2017-05-17 11:07:01
收藏:0
阅读:824
if(/[@#\$%\^&\*]+/gi.test($("#user_api_register_form").find("input[name=‘user_name‘]").val())) { $.showErr("用户名含有非法字符",function(){ $("#user_api_register_form").find("input[name=‘user_name‘]").focus(); }); return false; }
原文:http://www.cnblogs.com/xuzhengzong/p/6866276.html
评论(0)