What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
How can I validate the field to make sure contestants enter the correct photo URL?Asked by fotoconcursosame on October 29, 2016 at 06:50 AM
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?
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.
2. Add a Upload File field in your form.
3. Click the Conditions button in the Form Builder.
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.
If you need further assistance, let us know. Thank you.
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.
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.
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.
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:
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.
2. Open the Conditions by clicking it in the top toolbar.
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.
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.
Let us know if you need further assistance. We'll be happy to help you. Thank you.
Thank you very much, that's what we needed!