Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.

Monday, December 05, 2011

Sample Code New URL Validation


<html>

<head>



</head>

<script language="javascript">



function isURL(s) {

        var regexp = /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/;

        alert(regexp.test(s));

}

</script>



<body>

        <form>



        <input type="text" name="url" size="20" id="url"/>



        <input type="button" value="Validate" onClick="javascript:isURL(document.getElementById('url').value);"/>



    </form>

</body>



</html>

No comments:

Post a Comment