Forum

Thread tagged as: Question, Configuration, Forms

Search form problems

Hey,

I have the search bar working and it searches fine, but why does it display search results on the same page its located?

for example if I search for something on the home page, I want to see the search results on search.php not on the home page. It needs to direct to a search page to display search results, like WordPress does.

Any way I can do this?

Cheers!

Kieran

Kieran Hunter

Kieran Hunter 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

You post to a different page which shows the results.

Just create a page with the code that shows the results from our example, and post to it.

If you've copied the form code from the example search page included with the download that posts to itself, as it is just an example. You can post to that page or post to a different page that you've created. It's up to you.

Set action="page_url" in the form if you want form to post to another page instead of submitting to self.

Oh man.. so good!

For people in the future reading this, you have to put something such as.. action="/search.php"

..inside the <perch:form /> as opposed to the input.

Thank you for your quick responses! :)

Kieran, If this has answered your question could you please choose a response as solution which will let others know this issue has been solved. Puts a little checkbox in forum indicating solved.

RK :)