View - How to not refresh when filtering

By: Peter S | Asked: 10/29/2024
ForumsCategory: General questionsView - How to not refresh when filtering
Peter S asked 2 months ago

Hi, 
I have a database that I display on my site. I have the form above the view which i use to filter the results. Is there a way to filter results without the webpage needing to refresh? 
Thanks!

Question Tags:
2 Answers
Victor Font answered 2 months ago
Database? What database? Formidable doesn't create databases to display data. You have a search form and view and want to filter the view with search form with refreshing the page. Even if you were to load every single form entry, you would still have to refresh the view. Filtering takes place on the server, not in the browser.

You may be able to switch things up and use datatables instead. The datatables search works differently with jQuery.
Peter S replied 2 months ago

It is just a view. Formidable has a whole video on building a "Database" using a view which is why I used that term.

Victor Font replied 2 months ago

I wish Formidable's docs wouldn't say things like that. It's misleading and the terminology causes confusion. Either way, the rest of the answer still applies.

Erik Meeder answered 2 months ago
Hi Victor and others. I'm new to Formidable forms and I'm running into similar issues as Peter. I have a data entry form on the top of the page. Below this form i have 2 searchable 'views' to search through entries on other 'forms'. I notice when i do a search which assists me in entering the data in my main form on the top, i notice that my entire form refreshes and all my half entered data in the form is lost. Is there a built in way or a setting that will prevent this from happening? Perhaps a 'save draft' and reload the draft page whenever a search is performed? Or s this behavior unavoidable? Thanks for any help or suggestions.
Victor Font replied 2 months ago

That's an interesting architecture. What do mean by searchable 'views'? How are you initiating a search?

Erik Meeder replied 2 months ago

I used the tutorial on the Formidable site to create my search.
https://formidableforms.com/knowledgebase/create-custom-search-form/
I have a data entry form which holds entered data as well as uploaded data.
I have a Grid 'view' (which looks more like excel table) which displays the data.
Then i created a search 'form' which connects to the 'view' to search it and display search results only.

I enterer a word to search for and click the 'search' button. At this point my page refreshes and i see the search results. But at the same time all my form data is lost.

Victor Font replied 2 months ago

This is very confusing. You have a data entry form and a search form on the same page? What data are you displaying in the view and what are you searching for? Search forms display data that has been previously been entered. When you enter a search it triggers a form submit. There is no work around to this when you have multiple forms on a single page. You are handing priority to one form over the other. There are ways to solve this but all require advanced programming by and experienced.

I wouldn't use a search form at all. I would AJAX to trigger a search on the server and replace your view content without refreshing the page or triggering a form submit.

That's not the only way to do it either. There are other ways, but I wouldn't recommend them to anyone without significant WordPress/Formidable Forms experience, because it requires creating WordPress templates or custom add-on. Not many small business have the budget for that.

Erik Meeder replied 2 months ago

<p>thanks for the input. The form is essential for keeping track of vehicle bids/appraising. Formidable has enough features to do minor calculations and then storing the data for each appraisal. In the search forms on the same page i search up recent appraisals and another data set of market data that assists in appraising the current vehicle. In Form setting there is the settings for AJAX - 'Submit this form with AJAX' (the pop info says it will submit the form without refreshing the page) I was hoping this might solve the issue, but it seems to do nothing whether it is checked or unchecked,</p>

Victor Font replied 2 months ago

You can sure try it but it's not going to help because in order to show the retrieved data, you must refresh the page.

AJAX is the solution but is is custom code. You have to write PHP code to create the callback function for the jQuery you need to create to pass the right REQUEST payload so you can received and process the RESPONSE. If you've never this type of coding before, make an appointment to map out a plan with a developer maybe as mentor even if you want to do it yourself and need a extra pair of eyes to make sure it's done right.

For a developer to write the code, it might cost you $1k or more USD to produce the code you need. Don't rely on ChatGPT either. I have never seen it produce correct code for Formidable. It's always too form generic and needs much modification. Good luck with your project.

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