Hello Guys... I need help about my validate scripts...
$(document).ready(function(){
//Validation
jQuery.validator.addMethod('validIPurl', function(value) {
var ip = '^([01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]).([01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]).([01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]).([01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])$';
var URL = /^(http|https)?:\/\/[a-zA-Z0-9-\.]+\.[a-z]{2,4}/;
//HOW TO JOIN AND VALIDATE BOTH VARIABLE IP AND URL????
}
}, 'Invalid Address');
//if(/^(http|https|ftp):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/i)
$(".myfirstform").validate(
{
rules:
{
ip: {
validIPurl: true
}
},
);
},
I use jquery.validate javascripts to validate user input..
I also try to create if..else to join IP and URL but the control statement not working
Hope you guys can help for the solution...