When lost focus from the input box the script will check the URL against its Syntax $(‘input’).keydown(function() { if (ischeckUrl($(this))==1){ alert(“enter a valid url…”); } }); //function to check URL function isCheckUrl(checkurl){ if(/^(http|https|ftp)://[a-z0-9]+([-.]{1}[a-z0-9]+)*.[a-z]{2,5}(:[0-9]{1,5})?(/.*)?$/i.test(url)) { return 1; } else { return -1; } }