How to store/save a previous set of form inputs as a 'save search' function?

Hi all,

I have a form with 29+ inputs that I’m using to create a search query to an external API. I’d like to provide the end user with the ability to ‘save’ their search, which is essentially a combination of the form inputs - so the user can then use these again in the future.

For these to be re-used in the future, I imagine the best approach is to create a savedSearch DB table - which I’ve done, and have a field for every form field that can be used.

Then when the user selects a specific search I imagine I can just bind the value to the form input on the page - essentially creating a ‘saved search’.

What I’m struggling with is how to get the current search form fields from the form and into the DB. The most obvious solution was to on form submit to send the input values to an array, and then send that array data via a form input, or a $_GET to a SC. - I just can’t seem to find a way to transfer the form input values anywhere.

If anyone has any suggestions to guide me in the right direction, I’d appreciate it. Also VERY open to a better way to create a ‘saved’ search as above!

Matt

Community Page
Last updated: