Custom Search Filter with drop down selection

I’ve created several forms using your guides and have been able to create the custom displays to show a listing of the entries. However, now I need to create a custom search form so that users can filter their results by the different fields in the form.

For example, I’d like users to be able to search for a surgeon by name or by state. How do I create a search form with a drop down box so that they can get all surgeons from a certain state, or select a surgeon by name?

http://formidablepro.com/knowledgebase/advanced-search-forms/

The drop-down box for finding a surgeon by name is working now. Woohoo! However, when I create the drop-down box with the states, it is listing duplicate entries. For example, if I have 2 surgeons located in Alabama, the drop down shows Alabama listed twice. How do I get it to display each state only once and then route to a page with all the physicians in that state listed?

PS, I was using the guide. It was somewhat helpful, it led me in the right direction about creating the search as a form, but I feel like it didn't explain what needed to be placed in the dynamic content field. Specifically, I didn't realize that it needed to include the field id of the other form it was pulling the data from, IE, something like [rnwlnx show=surgeonsname]

When you reference a data from entry field it populates every entry entered. So if you had entered a value twice it will always show up that way. It's a caveat of the data from entry fields. You'll have to create a custom workaround. You could create a drop-down field with all the states.

 

ok, I know how to create the drop-down field but can you elaborate more on how to accomplish this? Does it need to be a separate search form? How do I get the selection to point to a page with a list of the physicians in that state?

I assume this advanced search form is going to be exactly like the example. When you create the new drop down you will need to note the field id. Then you will plug it in like in the example.

[if 322]&usloc=[321][/if 322]

Lets say that the new drop down you created is id 321 and the actual one you use to store your entries data is 322. Change the "usloc" to whatever you chose in the get method (eg: [get-state]).

I'm not 100% certain this will work, but just looking at the logic it seems like it should. You will need to test to confirm.

Hmm, maybe I'm not placing things in the right fields. I haven't fully grasped how the custom displays and entries all tie together. Thank you for all of your help. I'm certain once I get this working that the light bulb will turn on & I'll be more self-sufficient.

Here's the page with the search form: http://www.femaletomale.org/resources/find-a-surgeon/ The search by name field works great, but the search by state is just loading the default content. Do I have to create a custom display for each state?

FORM #1: Add a Surgeon - Key - Add a Surgeon - form works

Surgeons Name - Field Key: surgeonsname (the field where they enter the surgeons name)
Surgeons State - Field Key: 97oioa (the field where they add the surgeons state)

FORM #2: Find a Surgeon - Key - sw5r3l

Search Surgeons by Name - Field Key: rnwlnx (the find a surgeon by name drop down)
Search Surgeons by State - Field Key: m8ucnt (the find a surgeon by state drop down)
Settings: Redirect to URL - http://www.femaletomale.org/resources/find-a-surgeon/about/?entry=[if rnwlnx][rnwlnx show=key][/if rnwlnx][if m8ucnt][m8ucnt show=display-key][/if m8ucnt]
Custom Display #1 - Search Surgeons - Key: searchsurgeons (this works fine and gives the layout for each profile)
<h1>[8]</h1>
<h2>Biography</h2>
[112]
<h2>Procedures Offered</h2>
[9]
<h2>Contact Information</h2>
[88]
[111]
[if 85]<a href="[55]">Website</a>[/if 85]
[86]
[editlink]
<p><a href="[detaillink]">[key]</a>
<p><a href="/resources/find-a-surgeon/about/[rnwlnx show=surgeonsname]">[rnwlnx]</a>

 

So you have one form that is collecting information on Surgeons and one custom display that is listing them. These are both working correctly right?

You then created a search form that you want to use to filter the results, and this is not working. Correct?

Will you provide a screenshot of your search form's redirect settings and a screenshot of the custom display advanced section that is displaying the search results?

Yes, that is correct. One form collects all the data. Within that form I have set up a custom display to display the surgeons entire profile.

Users can find a profile by using another form that has the search parameters (drop down boxes for searching by name or searching by state). I wasn't sure if I needed to set up a different display for each state, or if one display could be created.

Not sure where the attached files went, but you can find them here:

http://www.femaletomale.org/wp-content/uploads/screenshot-surgeons-display.jpg

http://www.femaletomale.org/wp-content/uploads/screeshot-search.jpg

http://www.femaletomale.org/wp-content/uploads/screenshot-display-by-state.jpg

Okay, I see a couple issues in your setup. The first problem is the redirect URL from your search form.

You have: femaletomale.org/resources/find-a-surgeon/about/?entry=[if rnwlnx][rnwlnx show=key][/if rnwlnx][if m8ucnt][m8ucnt show=display-key][/if m8ucnt]

Instead, you need something like:
femaletomale.org/search-results/?[if rnwlnx]name=[rnwlnx][/if rnwlnx][if m8ucnt]&state=[m8ucnt][/if m8ucnt]

The above URL would take you to a page on your site (search-results) where your custom display is. You can change "search-results" to be whatever page your custom display with the ID of 7 is on.

So based on the redirect URL above if someone searched for johnson in name and arizona in state, the URL the user gets redirected to would be:
femaletomale.org/search-results/?name=johnson&state=arizona

Then in your custom display 7, you need to change the form that it is pulling entries from to the same form you are using to collect the information, not the form you are using for searching. and you need to change the "where" options to pull the parameters out of the URL. To do that, they should look like:
where "doctor name"(or whatever the name of your name field is) is equal to [get param=name]
and add a second option:
where "state" is equal to [get param=state]

fixing those three things should get things working a bit better. All these instructions are also found on this page: http://formidablepro.com/knowledgebase/advanced-search-forms/

omg it worked! The only thing I needed to tweak was the get-param in the custom display. It needed to be set to [get-surgeonsstate] rather than [get-param=surgeonsstate]

Topic closed.