After DOM Load in body
$.validator.addMethod("bd_phone",function(phone){
var reg = /(^(\+88|0088)?(01){1}[56789]{1}(\d){8})$/;
if(reg.test(phone)){
return true;
}
return false;
},"");
if($(document.body).find('.minor').length){
$("#publicReg").validate({
rules: {
birth_date: "required",
district: "required",
gender: "required",
police_station: "required",
full_name_bangla: "required",
village_ward: "required",
full_name_english: "required",
post_code: "required",
father_name: "required",
mother_name: "required",
occupation: "required",
per_district: "required",
mobile: {
required:true,
bd_phone:true
},
per_police_station: "required",
per_village_ward: "required",
per_post_code: "required"
}
});
}
Comments
Post a Comment