Is it possible to create a search form...

By: Venue Llama | Asked: 01/24/2023
ForumsCategory: General questionsIs it possible to create a search form...
Venue Llama asked 1 year ago
that generates results from multiple entries, but with just one search field? I can create a standard search form with fields for: region state venue name¬†   But, I'd rather have a single search field so a user can simply type in any one of those when they arrive at the site. Example attached. thanks!

   
Attachments
1 Answers
Victor Font answered 1 year ago
It looks like you want a search field that responds like WordPress does when you type a search string in a website. This type of search won't work with Formidable as delivered. Each requires a different type of SQL search for either to return accurate results. As a content management system, WordPress uses a wildcard string format to search its content, which is all stored in a single table field. This is an easy, broad search for developers to implement. Formidable is a transactional system with much different functionality from WordPress, even though it is built on top the WordPress foundation. All of Formidable's entries are stored in two tables in the WordPress database. These tables follow a metadata schema design, which is the same schema WordPress uses. While the schemas are the same, there's a vast difference in intent. In Formidable's design, there is no single field to search for a specific text string that could be found in any one or more multiple fields. Yes, you could potentially return some sort values from the entry meta table by using a wildcard search, but identifying what you are actually returning as values is problematic. How will you know if you've returned an accurate value for STRING_A if you don't what field STRING_A belongs to? For the metadata model to work correctly, Formidable needs as much precision as possible to build very complex, targeted SQL queries on the fly when sent criteria from a search form to display a properly filtered view. The targeting process requires precise identification of field/value pairs, which is why you need multiple fields to pass as parameters to the View filter. If you haven't done so, I recommend learning about views in Formidable's Knowledgebase: https://formidableforms.com/knowledgebase/. If your requirement to use a search string based SQL query to display a Formidable View is set in stone, it could be done with custom code because you would need to return the field_id and entry_id for successful searches. You'd be able to use the field_id to separate the entries for display in the view.
Venue Llama replied 1 year ago

Thank you very much Victor for that thorough reply!

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right