You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've created a search form where you the user can enter search criteria and when they hit submit, the search results would, ideally, appear below the form. I'm using FormCollectionView to create the form as the user can add multiple criteria forms before submitting. I'm using the form_collection_valid method to get the cleaned_data so I can perform the search on the database. But at this point I'm not sure how to return the results to the browser. This method can only return a success_url. Is there a way to return the results via Ajax, so the page doesn't reload? I can save the values to the database and my success_url have parameters to reference the saved data, but I would prefer to do this all in the same view, if possible, and not have to save the data if the user doesn't need it for later.
The text was updated successfully, but these errors were encountered:
jrief
changed the title
I've created a search form where you the user can enter search criteria and when they hit submit, the search results would, ideally, appear below the form. I'm using FormCollectionView to create the form as the user can add multiple criteria forms before submitting. I'm using the form_collection_valid method to get the cleaned_data so I can perform the search on the database. But at this point I'm not sure how to return the results to the browser. This method can only return a success_url. Is there a way to return the results via Ajax, so the page doesn't reload? I can save the values to the database and my success_url have parameters to reference the saved data, but I would prefer to do this all in the same view, if possible, and not have to save the data if the user doesn't need it for later.
Use emit() to forward response data
May 12, 2023
I've created a search form where you the user can enter search criteria and when they hit submit, the search results would, ideally, appear below the form. I'm using FormCollectionView to create the form as the user can add multiple criteria forms before submitting. I'm using the form_collection_valid method to get the cleaned_data so I can perform the search on the database. But at this point I'm not sure how to return the results to the browser. This method can only return a success_url. Is there a way to return the results via Ajax, so the page doesn't reload? I can save the values to the database and my success_url have parameters to reference the saved data, but I would prefer to do this all in the same view, if possible, and not have to save the data if the user doesn't need it for later.
Originally posted by @anthonycalvano in #62
The text was updated successfully, but these errors were encountered: