How can I validate the field to make sure contestants enter the correct photo URL?

  • fotoconcursosame
    Asked on October 29, 2016 at 6:50 AM

    Hello

    I'd like to know whether it is possible to make a filed valid only in case it starts with specific characters.

    We need this because we are creating a form to be used for a photo competition. Contestants have to upload their photos to our photo gallery, and then they have to write in the text boxes the URL of their uploaded photos.

    As all the URL's of the photos uploaded to the gallery start with "http://fotometeo.ame-web.org/albums/", we want to make sure that the URL they write in the boxes starts like that, and if it's not the case they skould not be validate. Would this be possible?

    Thanks

    Fernando

  • John_Benson
    Replied on October 29, 2016 at 6:40 PM

    This is possible by using Enable/Require Field conditions. First, here's my demo form and a guide on how I made this form: https://form.jotform.com/62424109153953.

    The file upload file field is disabled unless the user type the word "fotometeo" in the text box. As long as the text field contains the string "fotometeo" the file upload field will be enabled. 

    1. Add a Text Box field in your form.

    How can I validate the field to make sure contestants enter the correct photo URL? Image 1 Screenshot 50

    2. Add a Upload File field in your form.

    How can I validate the field to make sure contestants enter the correct photo URL? Image 2 Screenshot 61

    3. Click the Conditions button in the Form Builder.

    How can I validate the field to make sure contestants enter the correct photo URL? Image 3 Screenshot 72

    4. Create a "Enable/Require Field" condition wherein IF the URL entered by the user Contains the string "fotomeo" then the File Upload field will be Enabled.

    How can I validate the field to make sure contestants enter the correct photo URL? Image 4 Screenshot 83

    Please check these guides: 
    https://www.jotform.com/help/57-Smart-Forms-Using-Conditional-Logic 
    https://www.jotform.com/help/371-How-to-Enable-Disable-Fields-Using-Conditional-Logic

    If you need further assistance, let us know. Thank you.

  • fotoconcursosame
    Replied on October 30, 2016 at 7:05 AM

    Thanks for your answer John. I'm sorry I think I did not explain well what we need:

    We want contestants to upload their photos to our gallery (http:fotometeo.ame-web.org), and then write on the form the URL's of the photos as they appear in our gallery. So they have to fill only text boxes containing our gallery's URL's, but there is not any "Upload image" field.

    So this is what we need:

    - If all those text boxes start with "http://fotometeo.ame-web.org/albums/userpics/" then those fields are OK, and the form can be sent.

    - If any of those text boxes does not contain any URL or contains an URL that starts different to that, then that field should not be validated, and so user should not be able to send the form.

    I hope it's clearer now.

    Thanks again for your time.

  • John_Benson
    Replied on October 30, 2016 at 9:11 AM

    Yes, it is crystal clear. My demo form is just an example that your problem can be solved.

    Do you want to hide the submit button? The user won't be able to see it and submit their form unless the text boxes contains "http://fotometeo.ame-web.org/albums/userpics/".

    Let us know if you want that condition, we can guide you setting it up. We'll wait for your response. Thank you.

     

  • fotoconcursosame
    Replied on October 30, 2016 at 10:26 AM

    Hi again John

    In your demo there are two fields: one for typing the URL, and another one for uploading the photo. The second one will be enabled only in case the first contains "http://fotometeo.ame-web.org/albums/userpics/".

    But that is not what we need: We need only the text box for typing the URL to appear. Then, if that box starts with: "http://fotometeo.ame-web.org/albums/userpics/" it is OK and the form can be sent, but if that field is empty or does not start by "http://fotometeo.ame-web.org/albums/userpics/", then the sending should not be allowed, and that field should be emphasized so user realises something is wrong there.

    In other words: I simply need a text field that is validated in case it starts with some specific characters.

    I hope you may help me.

    Thanks for your patience.

    Fernando

     

  • John_Benson
    Replied on October 30, 2016 at 12:14 PM

    According to you:

    - Unable to send if text box doesn't starts with: http://fotometeo.ame-web.org/albums/userpics/
    - The form will tell the user that the URL is not validated if they type a wrong link or doesn't start with: http://fotometeo.ame-web.org/albums/userpics/

    You can do this in the Form Builder by using the Show/Hide Field condition. Please check my demo form: https://form.jotform.com/63034153995964. You can clone it so that you can see the actual condition.

    Here's a screen capture of the working demo form: 

    How can I validate the field to make sure contestants enter the correct photo URL? Image 1 Screenshot 60

    Here's how I created this demo form:

    1. I inserted 1 text box, 1 text field and make sure the submit button is visible.

    How can I validate the field to make sure contestants enter the correct photo URL? Image 2 Screenshot 71

    2. Open the Conditions by clicking it in the top toolbar.

    How can I validate the field to make sure contestants enter the correct photo URL? Image 3 Screenshot 82

    3. I created a condition Show/Hide Field condition wherein IF the user entered a URL that contains "http://fotometeo.ame-web.org/albums/userpics/" in the Image URL field, the Submit button will SHOW and then the "Image URL is not valid" will be hidden. 

    How can I validate the field to make sure contestants enter the correct photo URL? Image 4 Screenshot 93

    4. I created another Show/Hide Field condition wherein IF the Image URL field is empty, the "Image URL is not valid" text will be hidden.

    How can I validate the field to make sure contestants enter the correct photo URL? Image 5 Screenshot 104

    Let us know if you need further assistance. We'll be happy to help you. Thank you.

  • fotoconcursosame
    Replied on October 30, 2016 at 4:24 PM

    Thank you very much, that's what we needed!