jQuery form validation (CUSTOM VALIDATION)

Code Structure : 
$.validator.addMethod("field_name","function(value){}","Message");

jQuery Custom NID Validation : 

$.validator.addMethod("nid_valid",function(value){
   if(value.length == 10 || value.length == 13 || value.length == 17){
      return true;
   }else{
      return false;
   }
},"NID number length 10, 13, 17 is valid");

Comments

Popular posts from this blog

WP register_post_type() with custom CMB2 meta box

Git post receive setup at server for git push to the production from local machine