javascript - How to check validation of IP Address in jquery -


i need add ip validation in project .is there function in jquery or in jquery mobile.so validate in put field?

thanks

refer document ip validation

here has used jqueryvalidator.js , explained example.

 $.validator.addmethod('ip4checker', function(value) {             var ip = "^(?:(?:25[0-5]2[0-4][0-9][01]?[0-9][0-9]?)\.){3}" +                 "(?:25[0-5]2[0-4][0-9][01]?[0-9][0-9]?)$";                 return value.match(ip);             }, 'invalid ip address');              $('#form1').validate({                 rules: {                     ip: {                         required: true,                         ip4checker: true                     }                 }             }); 

Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -