can anyone help me with this javascript for validating url in aspx?
Posted
by orrep
on Stack Overflow
See other posts from Stack Overflow
or by orrep
Published on 2010-06-17T21:19:52Z
Indexed on
2010/06/17
21:23 UTC
Read the original article
Hit count: 141
heres my code - function Validate_URL(url) { var iurl = url.value; var v = new RegExp(); v.compile("/^(((ht|f){1}(tp:[/][/]){1})|((www.){1}))[-a-zA-Z0-9@:%_+.~#?&//=]+$/;"); if (!v.test(iurl.value)) { url.style.backgroundColor = 'yellow'; } return true; }
no matter what i put in url, say http://www.abc.com/newpage.html, it returns false. how come?
© Stack Overflow or respective owner