<html>
<head>
<title>Check if it is a URL</title>
<script language="javascript">
function check(){
str = ;
str = (/http:\/\/.+/);
if (str == null){
alert('The URL you entered is invalid');
return false;
}else{
alert("The URL you entered is valid");
return true;
}
}
</script>
</head>
<body>
<form name="form1" onSubmit="return check()">
<input type="text" name="txt">
<input type="submit" value="check">
</form>
</body>
</html>