How do I validate a website address/URl

Home Forums Quform WordPress How do I validate a website address/URl

This topic is: resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #26630
    DASub
    Participant

    Is there an easy way to validate that text field input is a proper form for a website address? I guess I could add all possible TLDs as .com, .org, etc. using the Validator “In Array” and list them all out but is there a better/easier way to accomplish this? Thanks

    #26637
    katw
    Participant

    Hi @DASub

    The best way would be to use a REGULAR EXPRESSION (REGEXP) and add that to the field element Validator.

    There are heaps online you can source and test out.

    Watch out for old expressions that are not aware of new and legitimate TLD’s like .me, .support, .info etc

    You also need to think about the HTTP/HTTPS prefix check and the presence of a subdomain v’s www starting pattern.

    All the best

    #26641
    DASub
    Participant

    Found one. Works great. Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy