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

Support archive

What sort of sanitisation/validation does Low Search perform on inputs?

Keiron Lowe 15 Apr 2016 09:34 question, complete

I've got a situation where I can't use the normal form tag so I need to manually create the encoded query.

We're working on a property website and we have a form on the homepage which simply contains a keyword field, and a set of radio buttons for either Lettings or Sales, depending on which you choose it will redirect you to '/sales/search/{ENCODED_QUERY}/' or '/lettings/search/{ENCODED_QUERY}/''. I can't see a way of doing this using Low Search so Im setting the form to go to a php script which then manually recreates the encoded query and redirects to the right place.

What i'm wondering is, do I need to sanitise the the inputs or does Low Search deal with that when it performs the search?

Cheers!

Replies

  1. Low 15 Apr 2016 09:38

    You could actually use the Form tag here. You can move the result_page parameter inside the form and apply different values to it, based on a different selection, using JavaScript. Or use a radio button like this:

    <input type="radio" name="result_page" value="sales/search"> Sales 
    <input type="radio" name="result_page" value="lettings/search"> Lettings

  2. Keiron Lowe 15 Apr 2016 13:07

    You learn something new every day, that worked perfectly.

    Cheers!