Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8156853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:05:05+00:00 2026-06-06T17:05:05+00:00

On my homepage I have a simple search form. The user can enter some

  • 0

On my homepage I have a simple search form. The user can enter some filters and in a next step the search results are diplayed on a new page => this all works:

Below a simplified version of the view.py:

def search(request):
    form = SearchForm()
    if request.method == 'POST':
        form = SearchForm(request.POST)
        results = search(form)
        return render_to_response('search_results.html',{'results': results},context_instance = RequestContext(request))
    else:
        form = SearchForm()
    return render_to_response('search.html',{'form': form},context_instance = RequestContext(request))

Now the problem:
In a next step I want to add the same searchform in the search_result.html page. The purpose would be that the user can refine the search results using that search form. In an ideal world the search form on search_results.html has already the filters entered in search.html prefilled.

I’m struggling a bit on how to approach this. Should I pass the orginal entered filters as a list to the search_result.html page? How can I do this? And how can I put these values as a default in the form? Maybe I’m overthinking this somehow, but at this moment I don’t see a good solution.

Any feedback, directions are very much appreciated!

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:05:06+00:00Added an answer on June 6, 2026 at 5:05 pm

    Can’t you just make your context dict {'results': results, 'form': form}? This would make the form available again with the previously posted data already bound to the form.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im new to symfony and have some simple questions. I am trying to understand
I have a rails app that has some simple functionality, allowing the user to
I'm new to codeigniter this is my case: I have a homepage with a
I have a form on my homepage that is set up to submit via
I have a simple script to fade in the homepage of the website, something
i'm new into JS. I have done 2 simple functions to change value and
i have a simple contact page on my private homepage. Offline it works perfectly,
I have a very simple slideshow setup on my homepage with fading images using
I'm new to PHP and have run into a rather simple yet annoying issue.
I have a form in the homepage of a site, used as an include,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.