Wednesday, May 21, 2008

URL Validation With Javascript

Hi friends. in this post i will explain How can we Validate Web abbress. Once upon i want regular expression in my application which can eliminate full url like ( Not just i tried hard to find but i cant. so i have to develop my own. This is the function i have used:
function ValidateURL(url) { var regexp=new RegExp('^(http[s]?://ftp://)(w{3}\.{1})([A-Za-z0-9]+\.{1}) (comedugovintmilnetorgbizarpainfonameproaerocoopmuseum([a-zA-Z]{2})) ((\.{1})([A-Za-z0-9]{2,3}))?$'); if(!url.match(regexp)) { alert('Please Enter a valid URL: For Eg. "" or "" '); return false; } } You can refer Below Post for develop your own Regular expression on article Regular Expression Syntax & use in ASP.Net C#.Net

No comments:

Post a Comment

Comments posted on ASP.Net Ajax Tutorials Blog are moderated and will be approved only if they are on-topic and not abusive. Please email me or my team for tech-support or blogging related questions. Avoid including website URLs in your comments - Thanks Author