Jump to content
  • 0

Required search field


ahollander

Question

Is there a way to have a search form with multiple fields to have one or more required fields? For example, I have a form with three search fields: Name, City, and State (which is a dropdown list). I want to require the user to input a City and select a State. In other words, I don't want the user to be able to just search for any Name in a particular State, I want the user to only search for Names within a particular City in the State - primarily to limit the number of results.

I tried using a dropdown list for City (as well as for State), but the dropdown list is not limited to the cities for the particular State selected; instead it shows all of the distinct cities for every State.

I would also like to be able to make the City and State optional if the user inputs a Name for the Search - would this have to be done as a separate DataPage, or could the DataPage have two optional forms of search - search by Name or Search by City and State?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Is there a way to have a search form with multiple fields to have one or more required fields? For example, I have a form with three search fields: Name, City, and State (which is a dropdown list). I want to require the user to input a City and select a State. In other words, I don't want the user to be able to just search for any Name in a particular State, I want the user to only search for Names within a particular City in the State - primarily to limit the number of results.

I tried using a dropdown list for City (as well as for State), but the dropdown list is not limited to the cities for the particular State selected; instead it shows all of the distinct cities for every State.

I would also like to be able to make the City and State optional if the user inputs a Name for the Search - would this have to be done as a separate DataPage, or could the DataPage have two optional forms of search - search by Name or Search by City and State?

One way to do this is to set the minimum characters for the City and State field. If the State field is a dropdown, have an option with Text to Display "Select" and leave the value blank. Then set the minimum character to anything greater than 1 character. This way, if the user leaves the State dropdown with "Select" as the option, it would prompt the user to select a valid option because the minimum character for the dropdown is not met. You can configure the error message that shows up through DataPage Styles.

Link to comment
Share on other sites

  • 0

Good news!

This is now a standard feature where you can check the field as a required field on the search form just like how you set it up on a web form. Simply go to the "Configure Search Fields" screen and check "Required" checkbox for the fields you want them to be mandatory.

Best,

Bahar M.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...