Quote:
Originally Posted by Warwick
Well if it is a valuable url i.e. something.something.tld
|
So something like "domain.tld" or "domain.domain.tld/smth.php" is considering to be an invalid URL and no matter if 'http://' is present?
Try something like this:
Code:
var value = product_option_value("url");
if (value == false ) {
alert("Sorry, you should enter an url");
return false;
}
var re = new RegExp(/^(http:\/\/)?[^\.]+\.[^\.]+\.[^\.]+$/i);
if (! re.test(value)) {
alert("Url you provided seems to be incorrect");
return false;
}