0

I am using the simple search form on EE 2.8.1 with the following tag:

{exp:search:simple_form
                    channel="blog|products|faq"
                    where="any"
                    results="20"
                    form_class="et-search-form et-hidden"
                    no_result_page="/search/"
                    result_page="/search/results"

                }
                <input type="search" class="et-search-field" placeholder="Search …" value="" name="keywords" title="Search for:">
                {/exp:search:simple_form}

The form works as intended when there is a search result. If there is no search result the form will throw the error "The action you have requested is invalid".

Removing the no_result_page parameter will result in EE showing me "Your search did not return any results." message.

I suspect the secure form submission issue and included

 <input type="hidden" name="XID" value="{XID_HASH}">

But no luck.

Cheers

1

Try to modify your no search results parameter to include the index template of that group

no_result_page="search/index"

The parameter should include the template group and template:

http://ellislab.com/expressionengine/user-guide/add-ons/search/simple.html#no-result-page

| improve this answer | |
  • Thanks, but that does not work either. – Christian May 2 '14 at 0:12
  • Thank you! I came upon this error and found I had my template name misspelled for my no_result_page="" parameter – Anna_MediaGirl May 23 '14 at 18:03
  • I think you also have to have a designated no results template. – Johnathan Waters May 23 '14 at 19:39
1

In order to make this work, and not get the "The action you have requested is invalid" message when there are no results, I also had to set the template in the no_result_page parameter to a different template than the result_page template.

On further investigation, however, it seems that the problem specifically lies with the EE search engine returning "no results" and loading a template that uses the {exp:search:search_results} tag. (So, potentially, you could re-use the same template if you had some sort of conditional.)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.