function urlValidator(elem, helperMsg){
var urlExp = /^http?\:\/\/(www\d?\d?\d?\d?\.)?([A-Za-z0-9-_]+\.)?[A-Za-z0-9-_]+((\.[A-Za-z]{2,6})(\.[A-Za-z]{2})?([0-9-_%&\?\/\.=]*))$/;
if(elem.value.match(urlExp)){
return true;
} else {
alert(helperMsg);
elem.focus();
return false;
}
}
0 comments:
Posting Komentar