I need to add IP Validation in my project .Is there any function in jquery or in jquery mobile.So that it will validate the in put field?
Thanks
This should work for IP address
$.validator.addMethod('IP4Checker', function(value) {
var ip="^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\." +
"([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\." +
"([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\." +
"([01]?\\d\\d?|2[0-4]\\d|25[0-5])$";
return value.match(ip);
}, 'Invalid IP address');
$('#remoteForm').validate({
rules: {
ipAddr: {
required: true,
IP4Checker: true
}
}
});