Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: url validation

  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Posts
    439
    Thanks
    3
    Thanked 0 Times in 0 Posts

    url validation

    Hi.... I was searching all night for a url validation script... Do u know any?

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I do not understand the question....
    Can you please elaborate....

    .....Willy

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Posts
    439
    Thanks
    3
    Thanked 0 Times in 0 Posts

    yep

    The user in a ul textbox enters a url... i want to check if it is valid or not

  • #4
    New to the CF scene
    Join Date
    Aug 2004
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you mean something like this?
    Code:
    if(form.HomepageURL.match(/^http:\/\/\w+(\.\w+)*\.(\w{2}|com|net|org|mil|int|edu|gov|info|biz|coop|aero|pro|name|museum)(\/[\w\-\.])*$/) == null){
        // invalid URL!!
    }
    (regexp written on the fly, not tested. Reaplace form.HomepageURL with the string to validate)

    <edit>this board inserts two spaces in "a ero" not sure why, remove them</edit>
    Last edited by Matt RW; 08-14-2004 at 10:37 AM.

  • #5
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I wonder if he's asking to check further if the url is not dead.. (it's one thing for a url to be typed in correctly, but if it doesn't point anywhere..)

    I'm actually not sure how to do this using Javascript. It may not be possible? I'm sure it can be done using PHP or some other server-side language..

    Sadiq.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •