How to validate complete URL?

  • Profile Image
    acpevans
    Asked on June 29, 2015 at 02: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.

  • Profile Image
    ibrahim
    Answered on June 29, 2015 at 03: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.

  • Profile Image
    acpevans
    Answered on June 29, 2015 at 03: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.

  • Profile Image
    ibrahim
    Answered on June 29, 2015 at 03:46 AM

    Hi,

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

  • Profile Image
    acpevans
    Answered on June 29, 2015 at 04: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?

  • Profile Image
    ashwin_d
    Answered on June 29, 2015 at 09:16 AM

    Hello acpevans,

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

    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:

    Hope this helps.

    Do get back to us if you have any questions.

    Thank you!