I'm working in a module that had the option to enter five website urls. So i need validation for those input fields. I tried to find out some plugins but didn't find anything so I'm trying to build a custom validation.I tried some code. Actually what I'm trying to achieve is that when a user enters a url into this 5 input fields i need to check whether any of this object in the array exists in the url .
function savewebsite(){
var cars = ["facebook", "amazon", "instagram", "twitter", "youtube", "paypal", "twitch", "tiktok", "cash.app", "onlyfans", "skype", "gofundme", "manyvids", "snapchat"];
for (var j = 1; j <= 5; j++) {
for (var i = 0; i < cars.length; i++) {
if ($('#sociallink'+j).val().indexOf(cars[i]) > -1) {
return false;
// alert("hai");
} else {
}
}
}
}