Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filtering http://

Status
Not open for further replies.

Moooink

Technical User
Feb 22, 2002
48
0
0
US
is there a way to validate a form to check and see if a user has included the http:// in a url form. having trouble with people simply typing and this is causing problems. is there a snipplet anywhere that has this validation code, or anything like that? thanks
-moo
 
<script language=&quot;javascript&quot;>
function checkHTTP(field) {
if (field.value.indexOf(&quot; != 0) {
alert(&quot;You forgot the return false;
}
}
</script>

<input type=&quot;text&quot; onblur=&quot;checkHTTP(this);&quot;/> =========================================================
if (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top