Option to disable submit when users types an incorrect site name on form

  • CathyNickelson
    Asked 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?

  • Mary JotForm Support
    Replied 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. Option to disable submit when users types an incorrect site name on form Image 1 Screenshot 40

    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.
      Is there a way to set up the form to auto select an option? Image 3 Screenshot 82 Screenshot 72 Screenshot 30 Screenshot 51
    • Select the option Show/Hide Field.
      Condition: show column 2 fields only after column 1 fields are filled out Image 1 Screenshot 41 Screenshot 62

    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.

    Option to disable submit when users types an incorrect site name on form Image 2 Screenshot 73

    Here's how the form should work.

    Option to disable submit when users types an incorrect site name on form Image 3 Screenshot 84

    Give it a try and let us know how it goes.

  • CathyNickelson
    Replied 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 Support
    Replied 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:
    1. In the Form Elements window, go to Widgets.
    2. Search for the Spreadsheet to Form widget and drag it to. your form.

    Option to disable submit when users types an incorrect site name on form Image 1 Screenshot 100

    • On this demo, here's the data in the Excel file I have, I listed the Site Names:

    Option to disable submit when users types an incorrect site name on form Image 2 Screenshot 111

    • In the widget's settings:
    1. Change the widget's label.
    2. Upload the Excel file.
    3. Select Yes, under the Submit Input Field Value.

    Option to disable submit when users types an incorrect site name on form Image 3 Screenshot 122

    • You can also change the buttons or warnings in the widget settings.

    Option to disable submit when users types an incorrect site name on form Image 4 Screenshot 133

    • 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.

    Option to disable submit when users types an incorrect site name on form Image 5 Screenshot 144

    • 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.

    Option to disable submit when users types an incorrect site name on form Image 6 Screenshot 155

    • 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.

    Option to disable submit when users types an incorrect site name on form Image 7 Screenshot 166

    Option to disable submit when users types an incorrect site name on form Image 8 Screenshot 177

    Here's th output:

    Option to disable submit when users types an incorrect site name on form Image 9 Screenshot 188

    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. 

  • CathyNickelson
    Replied 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 Support
    Replied 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:

    1. In the Form Elements window, go to Widgets.
    2. Search for Dynamic Dropdowns and add it.
    3. After it's added, click on the Wand icon next to the widget.
    4. In the Values box, paste all your options.

    Option to disable submit when users types an incorrect site name on form Image 1 Screenshot 30

    Here's a demo of how the widget works:

    Option to disable submit when users types an incorrect site name on form Image 2 Screenshot 41

    Give it a try and let us know if you need any other help.

  • CathyNickelson
    Replied on May 7, 2024 at 5:31 PM

    That will work! thank you so much