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

2 Answers 2

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

3
  • Thanks, but that does not work either.
    – Christian
    Commented May 2, 2014 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
    Commented May 23, 2014 at 18:03
  • I think you also have to have a designated no results template. Commented May 23, 2014 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.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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