Quote from: mmjaeger at Jan 17, 2007, 07:24 AM
I’m kind of struggling with this as well - is it possible to have the search form as well as the result on the same page - if yes, I’d appreciate if somebody could give me an example.
You can do this in two ways. If you want to use the search field and display the results directly beneath it, just use the call [!AjaxSearch!]
If you want to use the search field somewhere and display the results elsewhere (i.e. in 2 different divs) then you can use the procedure described above, only use the ID of the same page as landingpage. For example, if the ID of your page is 8, use these calls in the different places
on the same page:
For the searchfield: [!AjaxSearch? &AS_showResults=`0` &ajaxSearch=`0` &AS_landing=`8`!]
And for the results: [!AjaxSearch? &AS_showResults=`1` &AS_showForm=`0`!]
Quote from: mmjaeger at Jan 17, 2007, 07:24 AM
Moreover, I can’t get the ajax version of the script to work - if I enable immideate search while I’m typing, I get an AJAX error. Another issue is when I click on that ugly button that clears the result area, I get a javascript error.
Am I doing something wrong?
Well, I had problems with AJAX errors too and I found the solution in the support thread for AjaxSearch. You should call AjaxSearch uncached on a cached page (as the examples above do). And I corrected the errors which were described here:
http://modxcms.com/forums/index.php/topic,5357.msg46411.html#msg46411
Since then I haven’t had any problems with AjaxSearch
And yes, the button that clears the result area (and stops AjaxSearch from working!) is ugly, but you can change that