js正則判斷

if(addreferee_no==""||addreferee_no==null){

$.toast({top:"50%", msg: "手機號不能爲空", type: "warn", close:3000});

return;

}

var phoneReg = /^((1[0-9][0-9])|(14[5,7])|(17[0,6,7,8])|(19[7]))\d{8}$/;

if(!phoneReg.exec(addreferee_no)){

$.toast({top:"50%", msg: "手機號碼格式不正確!", type: "warn", close:3000});

return;

}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章