All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

I need to return filtered results from a low search form with checkboxes

enginehouse 16 Oct 2012 19:33 question, complete

My client needs to filter a number of products using using your low search - I want to pass a query string to a template using ajax - can you give me a hand with the syntax? The filtering is done using checkboxes and I was going to serialise the forms output but I cant seem to get the template to filter the results like they do when posting the form back. Thank you!

Replies

  1. Low 17 Oct 2012 15:02

    Hi!

    Serializing the search form should work like you describe.

    What does your search form look like? You can copy/paste the code in pastie.org to keep it readable.

    Also, does the filtering work without the Ajax call?

  2. enginehouse 18 Oct 2012 20:07

    Hi I beg your pardon I have sent this question again to your email - I didn't notice your reply here...

    The filtering works without the ajax:

    http://cv.deckchairdesign.co.uk/index...

    I am unsure if I need to add in extra parameters from the hidden fields to verify the input

    http://pastie.org/5080591

    Thank you for your help!

  3. Low 18 Oct 2012 20:22

    Quick reply while I'm in transit back home from a visit to the US -- if the filtering works without the Ajax call, then it should work *with* an Ajax call as well. Make sure all fields are sent correctly. Or use something like Firebug to look what the actual request is doing.

  4. enginehouse 18 Oct 2012 21:57

    Thank you for this - using chrome I am submitting this query string:

    http://pastie.org/5081040

    but I am getting a 404 returned. When I paste this into the browser and remove the result_page=products/category/trees/filter I get everything returned but no filtering.

    Sorry to hassle but can you think of something I am missing?

  5. Low 19 Oct 2012 13:48

    Yeah, the URL you're using is not correct. Are you using jQuery? In that case you could use something like this:

    $.post("/index.php", $("#my_search_form").serialize());

  6. enginehouse 20 Oct 2012 19:51

    Lovely! Thanks for your help - I was being a dumbass :)