Can I let users add a URL , if so is there away to make sure it only comes froma particualr domain?

  • Profile Image
    reddittikihut
    Asked on December 20, 2020 at 02:01 AM

    Hello,

    Is there a way I can let users enter a URL into the form? However I want to make sure that they only used URLS from a certain domain. For example, they can only add YouTube domain videos and nothinig else. Is that possible?

    Thank you in advance.

  • Profile Image
    Patrick_R
    Answered on December 20, 2020 at 04:36 AM

    Hi! Yes it is possible. You can use the SHOW/HIDE condition to detect the YouTube URL in the provided link and accordingly SHOW the Submit button (screenshot attached below).

    1608456998_5fdf1b26cd98f_chrome-capture

    Please check this demo form: https://form.jotform.com/203542366143046

    It will only allow YouTube URLs. If a different URL is provided, then the Submit button won't show up. Feel free to test this form or clone it under your account.

    This is the screencast of the preparation of this demo form: https://drive.google.com/file/d/1bE0tojKg7vyCk1ekpaeLS9l1OlF422hk/view?usp=sharing

    I hope this helps. If you have any questions, let us know.

    Thank you!

  • Profile Image
    reddittikihut
    Answered on December 20, 2020 at 06:18 PM

    Thank you Patrick_R. That is great!

    What if I need it to be either https://www.youtube.com/ OR https://youtu.be to be allowed since https://youtu.be

    is the alternative URL For Youtube?

    Thank you!

  • Profile Image
    Sonnyfer
    Answered on December 20, 2020 at 11:43 PM

    If that's the case, you can add the https://youtu.be in the condition set.

    1608525726_5fe0279e75e5c_

    Here's a demo form where I applied the above condition: https://www.jotform.com/203548849148972

    Please review and let us know if you need further assistance.

  • Profile Image
    reddittikihut
    Answered on December 21, 2020 at 12:52 AM

    Thank you Sonnyfer!!!
    And thank you for the extra step with the demo, so awesome of you.
    This totatlly fixes my dilemma for the 2 URLS but as I had asked elsewhere , what if I wanted to make the field optional?

    Meaning they can either leave it blank, or if they use it then they must use those 2 URLS is this possible?

    Thank you again for the amazing support!

  • Profile Image
    Sonnyfer
    Answered on December 21, 2020 at 02:14 AM

    Glad to hear that we're able to fix your dilemma.

    What if I wanted to make the field optional? Meaning they can either leave it blank, or if they use it then they must use those 2 URLS is this possible?

    Unfortunately, there's no way to prevent submissions for such case. You can, however, consider adding a paragraph field on your form to show an error message if the input doesn't match the 2 URLs. See sample below:

    1608534654_5fe04a7e65856_asq.gif

    If this could for you, below is how it's done:

    1. Add a paragraph field with the error message you like to show1608534765_5fe04aeda870d_
    2. Add the below condition to only show the error message if the URL input isn't youtube or youtu.be1608534829_5fe04b2d4e22f_

    Link to the demo form above: https://www.jotform.com/203551275834961.

    Please do review and let us know if you need further assistance.

  • Profile Image
    reddittikihut
    Answered on December 21, 2020 at 11:37 AM

    Thank you Sonnyfer!

    Just to make sure. It will only give a warning so someone could still ignore and click submit right?

    Would it make a difference if I limited to one IF - URL begins with "http://www.youtube.com"

    OR if is blank they can submit?

    Thank you! :)

  • Profile Image
    Bojan_J
    Answered on December 21, 2020 at 01:31 PM

    Greetings.

    Following my colleague's example, you can also add results if the conditions are true.

    That means that you can show the error message and hide the submit button:

    screenshot_3189.png

    This way, it would not be possible to submit the form unless all conditions are true.

    Let us know if this solution works for you.