How to validate complete URL?

  • acpevans
    Asked on June 29, 2015 at 2:54 AM

    What are the default validation requirements for URLs.

    For instance, if I had URL validation turned on and inputted the following:

    http://www.example.com

    www.example.com

    example.com

    Which of these would pass validation and which wouldn't?

    Many thanks.

  • ibrahim JotForm UI Developer
    Replied on June 29, 2015 at 3:07 AM

    Hi,

    I create a form with URL Validation option and yes, all of them pass validation. You can try it:

    http://form.jotformpro.com/form/51791651848971

    Hope this helps.

    Thanks.

  • acpevans
    Replied on June 29, 2015 at 3:40 AM

    Is there a way I can make the validation parameters stricter?

    For instance I only want http://www.example.com to pass validation.

  • ibrahim JotForm UI Developer
    Replied on June 29, 2015 at 3:46 AM

    Hi,

    Maybe you can add default value for validation. For example http:// or http://www. :

    How to validate complete URL? Image 1 Screenshot 20

  • acpevans
    Replied on June 29, 2015 at 4:51 AM

    That's half the answer and helpful. Thank you.

    However, what if someone deletes the "www."?

    I really need to change the validation rules so only http://www.example.com passes the test.

    This is because I'm syncing up the jotform submission to Quickbooks via Zapier and the whole process fails if a URL input for this box is not inputted with http://www.

    Can I change the validation parameters?

  • Ashwin JotForm Support
    Replied on June 29, 2015 at 9:16 AM

    Hello acpevans,

    Did you no that you can set a textbox field to validate a URL? Please check the screenshot below:

    How to validate complete URL? Image 1 Screenshot 30

    Since http://www.example.comwww.example.com and example.com all are valid URL, the above validation will not trigger any validation error.

    It is possible to achieve your requirement by adding "Condition logic" in your form. Please take a look at the following demo form I created for you:  http://form.jotformpro.com/form/51760140424950? 

    Feel free to clone this form for a closer look at the condition and see if this works as expected. The following guide should help you in form cloning:  http://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL 

    Please check the screenshot below for output of the condition:

    How to validate complete URL? Image 2 Screenshot 41

    Hope this helps.

    Do get back to us if you have any questions.

    Thank you!