-
CathyNickelsonAsked on April 2, 2024 at 1:10 PM
Hello,
in my field "Enter Site Name" is there a way to prevent submission if the name entered is NOT on my list of options?
Page URL: https://form.jotform.com/230436513613145 -
Mary JotForm SupportReplied on April 2, 2024 at 1:45 PM
Hi CathyNickelson,
Thanks for reaching out to us for help. Since you are using a Short Text field to get the Site Name, you'll need to specify the names on the conditions to Hide the submit button if they entered an incorrect name. I'll walk you through setting that up:
First, you'll need to add a paragraph field that will show the error message. You can customize it any way you want.
- In the Builder page, click the +Add Form Elements.
- Under the Basics tab, locate the paragraph field and add it to your form.
- Add the message you'd like the users to see when they type the incorrect site name and click the Save icon.
Second, is to add the show/hide conditions on your form. Here's how to add the conditions.
- In the Builder page, click Settings.
- In the left-hand panel, select Conditions.
- Click the +Add a new condition button.
- Select the option Show/Hide Field.
In my sample form, here are the conditions I added to prevent me from submitting on the form if I type an incorrect site name. You'll need to make sure that the site name must be filled out, otherwise this will prematurely show the error message since the blank field suggests the condition that it's an incorrect data. Also, you need to specify if the site name is not equal to the correct site name as well, and make sure to set the rules to All. After establishing the rules, you then select the outcome, first is to show the error message and hide the submit button.
Here's how the form should work.
Give it a try and let us know how it goes.
-
CathyNickelsonReplied on April 26, 2024 at 5:14 PM
That's really close to what I need. How do I set the "target" to be anything from the list of option in my site name field?
-
Rose JotForm SupportReplied on April 26, 2024 at 6:48 PM
Hi CathyNickelson,
Thanks for getting back to us. I suggest that you add the Spreadsheet to Form widget to your form. This widget can validate the user's entry if you list the site name on an Excel file that you can upload to the widget. Let me walk you through on how you can use it on your form:
- Add the Spreadsheet to Form widget:
- In the Form Elements window, go to Widgets.
- Search for the Spreadsheet to Form widget and drag it to. your form.
- On this demo, here's the data in the Excel file I have, I listed the Site Names:
- In the widget's settings:
- Change the widget's label.
- Upload the Excel file.
- Select Yes, under the Submit Input Field Value.
- You can also change the buttons or warnings in the widget settings.
- You can hide the current "Enter your site name" field since you will not be using it anymore. Don't delete it because the data collected using that field will be deleted too.
- Add this show/hide conditional logic to only display the Submit button and the rest of the form if the user entered a correct site name based on the data in the uploaded Excel file in the widget.
- On the two conditions where the current "Enter your site name" field is included, please update it and replace it with the new "Enter your site name" which is the spreadsheet to form widget.
Here's th output:
Here's my demo form, you can also clone it for your reference. Here's the guide on How to Clone an Existing Form From a URL.
Let us know if there’s anything else we can help you with.
-
CathyNickelsonReplied on April 30, 2024 at 2:50 PM
Thanks for this idea. Is there a way for this widget to show the options in the list when a person starts entering a name and then that name can be clicked. Similar to the function of the original Name field I had.
I don't want people to have to type the entirety of the Site Name exactly perfect but would rather they start typing it and then can select the one they want.
-
Gian JotForm SupportReplied on April 30, 2024 at 3:12 PM
Hi CathyNickelson,
Thanks for getting back to us. In that case, you can use our Dynamic Dropdowns widget instead. This widget can let you list a long number of options and the users can type in a certain word and the widget automatically shows the filtered options based on the keyword. Let me show you how to add it:
- In the Form Elements window, go to Widgets.
- Search for Dynamic Dropdowns and add it.
- After it's added, click on the Wand icon next to the widget.
- In the Values box, paste all your options.
Here's a demo of how the widget works:
Give it a try and let us know if you need any other help.
-
CathyNickelsonReplied on May 7, 2024 at 5:31 PM
That will work! thank you so much