Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Web URL validation


Message #1 by "Paul David Jacobs" <jacobspd@g...> on Mon, 10 Mar 2003 11:56:03 -0600
Hi All,

In reference to my previous problem=85 thanks to the help of Sten 
Hougaard
I have constructed the following code.

var myRegExp=3D/(http:\/\/)/gi;
var myArray =3D myRegExp.exec(document.addfav.favURL.value);

if ((myArray) && (myArray.length =3D=3D 1) && (myRegExp.lastIndex =3D=3D 
7))
{
return true;
}
{
alert("Falta 'http://' en la direcci=F3n del sitio\n");
addfav.favURL.focus();
return false;
}

However it flags a problem whether you put in a correct URL or not.
Have I made an obvious mistake?

Would appreciate your further assistance...

Paul D. Jacobs
Web Applications Developer and Information Systems Manager
jacobspd@g...
  _____ 

Servicios Interactivos Internacionales S.A. de C.V.
Via Ceti #56, Fracc Luis Enrique Erro,
Planetario Lindavista,
C.P 07730
M=E9xico D.F.




  Return to Index