We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Solved - Handling Error: You did not submit a search term

How Do I?

Rayln's avatar
Rayln
2 posts
3 years ago
Rayln's avatar Rayln

I’m looking for some help on handling this error: You did not submit a search term specifically when a user submits a search form without a keyword in the input field.

Note that the form with a keyword works fine.. I am able to redirect for no_results and if a result is found, so I know the form works. I am looking for a way to handle the error if a user inadvertently hits enter or clicks the search button without entering anything in the input field.

What I would like to do is to redirect to the same place the user ends up if there are no results so that the error code is branded to match the rest of the site.

       
Andy McCormick's avatar
Andy McCormick
322 posts
3 years ago
Andy McCormick's avatar Andy McCormick

Rayln, when using the native search add-on you’ll need to create a custom system message template to handle this error that you are getting. Here’s more info from the docs: https://docs.expressionengine.com/latest/control-panel/template-manager.html#system-message-templates

       
Rayln's avatar
Rayln
2 posts
3 years ago
Rayln's avatar Rayln

Perfect! I missed this in the documentation. Thank you!

       
adorable's avatar
adorable
2 posts
10 months ago
adorable's avatar adorable

If the default error page is being displayed by EE instead of allowing redirects via templates, you could try catching empty queries in your .htaccess file Block Blast Solver

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.