We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29781
    • 25 Posts
    Hello all,

    i am using AjaxSearch 1.9.0 under Evo 1.0.3. I have following situation:
    In the template of my website I have included
    [!AjaxSearch? &ajaxSearch=`0` &showResults=`0` &landingPage=`70`!]

    The call is in the template because I want a search-box in the header of every page. If I call AjaxSearch without &showResults=`0` and without &landingPage it shows the search-results on the same page, i.e it works. With the call above there is no visible action to the search-submit.

    If I copy the call from the template into the content of any page it works properly, redirects to the landingPage and shows the search-results.

    I have tried and read everything I could find and imagine but could not get to any solution.

    I would be glad if there is anybody here who knows the reason and a solution for my problem.

    Thesa
      • 5811
      • 1,717 Posts
      Could you post the AjaxSearch snippet call of the page 70. Thanks
        • 29781
        • 25 Posts
        I can, here it is:
        [!AjaxSearch? &ajaxSearch=`0`!]
          • 5811
          • 1,717 Posts
          [!AjaxSearch? &ajaxSearch=`0` &showInputForm=`0`!] should be better
            • 29781
            • 25 Posts
            I tried it with your call. This does not change anything. When I submit the search I don’t leave the page, on which I submitted the search-call. In the adress-bar I have then the following: http://www.domain.de/any-page.html?advsearch=oneword&search=searchphrase&sub=Suche%21. If I have the searchbox in the content and not in the template everything works fine …
              • 5811
              • 1,717 Posts

              I think you should check your input form, something should be wrong.

              On the demo site, all the templates of the pages have a gobal search. I use a chunk with the following content:
              [!AjaxSearch? &ajaxSearch=`0` &asId=`as0` &showResults=`0` &tplInput=`inputSearch` &landingPage=`17`!]
              I use &asId=`as0` because on many pages I have several snippet calls on the same page. But in your case this is not necessary and work without.

              The details of the tplInput is the following:
              [+as.showInputForm:is=`1`:then=`
              <form id="[+as.formId+]" action="[+as.formAction+]" method="post">
                  <fieldset>[+as.showAsId:is=`1`:then=`<input type="hidden" name="asid" value="[+as.asId+]" />`+]
                  <input type="hidden" name="advsearch" value="[+as.advSearch+]" />
                  <label>
                    <input id="[+as.inputId+]" class="cleardefault" type="text" name="search" value="[+as.inputValue+]"[+as.inputOptions+] />
                  </label>
                  <label>
                    <input id="[+as.submitId+]" type="submit" name="sub" value="[+as.submitText+]" />
                  </label>
                  </fieldset>
              </form>
              `+]


              On the landing page 17 I use this snippet call:
              [!AjaxSearch? &ajaxSearch=`0` &asId=`as0` &showInputForm=`0` &grabMax=`10`!]


              Check your input template and the generated code. You should get something like this (without as0_ prefix):
              <form id="as0_ajaxSearch_form" action="index.php?id=17" method="post">
                  <fieldset><input name="asid" value="as0" type="hidden">
              
                  <input name="advsearch" value="oneword" type="hidden">
                  <label>
                    <input id="as0_ajaxSearch_input" class="cleardefault" name="search" value="lon" onfocus="this.value=(this.value=='Search here...')? '' : this.value ;" type="text">
                  </label>
                  <label>
                    <input id="as0_ajaxSearch_submit" name="sub" value="Go!" type="submit">
                  </label>
                  </fieldset>
              </form>

              Hope is help you.
                • 29781
                • 25 Posts
                Hello coroico,

                your suggestion to examine the code of the template was the right hint …
                There was an unwanted form-tag around the AS-fieldset. I think it came from the template I use for this site. After deleting it everything works fine.

                Thank you much for your help.