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
Post a Comment