We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5950
    • 44 Posts
    I got AjaxSearch 1.8.4 working on a build of a site I’m working on about a month ago. I haven’t touched it since except to modify the CSS for it last week. I probably haven’t used the search function in about three weeks but the last time I checked it was working exactly as I set it up (not just right after setting it up, either, I would test that TVs were interacting the way I wanted, and so on).

    Then yesterday morning I get a comment from one of my colleagues that "When I initially looked at the site this was working but it seems to be broken currently?" Sure enough, I try it myself (FF3.6.2 and Saf4.0.4) and there’s no "submit", either on clicking the button or hitting "Enter/Return". Viewing source, the code doesn’t look any different to me.

    I’ve been adding/removing a few .js calls in the heads of interior pages (Template B), but there’s nothing on the home page (Template A) that wasn’t there the last time I checked the search (SmoothGallery/MooTools), so I have no idea what happened.

    Here’s the site build: http://www.comnet.net/Rework/

    Here’s my Ajax call (show form on the page but redirect to id=15 for results):

    [!AjaxSearch? &showIntro=`0` &ajaxSearch=`0` &resultsPage=`0` &AS_showResults=`0` &AS_landing=`15`!]


    My template:

    [+as.showForm:is=`1`:then=`
    <form [+as.formId+] action="[+as.formAction+]" method="post"><input type="hidden" name="advSearch" value="[+as.advSearch+]" /><label for="ajaxSearch_input"><input id="ajaxSearch_input" class="cleardefault" type="text" name="search" value="[+as.inputValue+]"[+as.inputOptions+] /></label><label for="ajaxSearch_submit"><input id="ajaxSearch_submit" type="image" name="sub" src="assets/images/search-button.gif" width="23" height="24" /></label></form>
    `+]
    [+as.showIntro:is=`1`:then=`
    <p class="ajaxSearch_intro" id="ajaxSearch_intro">[+as.introMessage+]</p>
    `+]
    [+as.showResults:is=`1`:then=`
    [+as.results+]
    `+]


    I’d appreciate any insight. Not knowing when it stopped working, I’m completely at a loss as to what triggered the problem.

    Thanks in advance!
      • 5811
      • 1,717 Posts
      You search input is inert because you havent’ any form ...
      reading the code of your page,I can’t find the form required by the submit button
      You have:
      <div style="height: 34px;" ajaxsearch_form="" action="index.php?id=15" method="post">
        <input name="advSearch" value="oneword" type="hidden">
      <label for="ajaxSearch_input">
        <input id="ajaxSearch_input" class="cleardefault" name="search" value="Search here..." onfocus="this.value=(this.value=='Search here...')? '' : this.value ;" type="text">
      </label>
      <label for="ajaxSearch_submit">
        <input id="ajaxSearch_submit" name="sub" src="assets/images/search-button.gif" type="image" height="24" width="23">
      </label>
      </div>

      where you should have:
      <form id="ajaxSearch_form" action="index.php?id=15" method="post">
      <fieldset>
        <input name="advSearch" value="oneword" type="hidden">
      <label for="ajaxSearch_input">
        <input id="ajaxSearch_input" class="cleardefault" name="search" value="Search here..." onfocus="this.value=(this.value=='Search here...')? '' : this.value ;" type="text">
      </label>
      <label for="ajaxSearch_submit">
        <input id="ajaxSearch_submit" name="sub" value="Go!" type="submit">
      </label>
      </fieldset>
      </form>

      The use of <div style="height: 34px;" ajaxsearch_form="" action="index.php?id=15" method="post"> instead of
      <form id="ajaxSearch_form" action="index.php?id=15" method="post"> is very strange. huh

      Are you sure that the template listed in your post is really used ?

      [!AjaxSearch? &showIntro=`0` &ajaxSearch=`0` &resultsPage=`0` &AS_showResults=`0` &AS_landing=`15`!]
      resultsPage and showIntro are not ajaxSearch parameters. So they are useless. Try simply:
      [!AjaxSearch? &ajaxSearch=`0` &AS_showResults=`0` &AS_landing=`15`!]
        • 5950
        • 44 Posts
        Ah ha!

        Yes, that was the right template, but here’s what happened (in both my templates, thanks to copy/paste):

        <div style="height: 34px;>[!AjaxSearch? &showIntro=`0` &ajaxSearch=`0` &resultsPage=`0` &AS_showResults=`0` &AS_landing=`15`!]</div></td>


        One of those whoopsies/typos that one just CAN’T see with one’s own eyes. Thank you so much for taking a look! Phew!