0

I am getting the results I want from my Low Search Form tag but would like to filter with checkboxes in my Low Search Filter tag. Could someone please help me with this? Thanks

My Low Search Filter tag uses Low Options, Low List and Solspace Tag:

{exp:low_search:filters query="{segment_3}"}
    {exp:low_options:project}
        {options}
        <label>
            <input type="checkbox" name="search:project[]" value="{option:value}"
            {if "{option:value}" ~ '/(^|\|)'.low_search_search:project.'($|\|)/'}checked="checked"{/if}/> 
            {option:label}
        </label>
        {/options}
    {/exp:low_options:project}

    {exp:low_list:each items="0|100:0 to 100;200|300:200 to 300;400|600:400 to 600" sep=";"}
    <label>
        <input type="checkbox" name="range:cost[]" value="{key}" {if key == low_search_range:cost} checked{/if}>
        {val} 
    </label>
    {/exp:low_list:each}

    {exp:tag:cloud}
    <label>
        <input type="checkbox" name="tag_id[]" value="{tag_id}"{if low_search_tag_id ~ '/\b'.tag_id.'\b/'} checked{/if}>
        {tag}
    </label>
    {/exp:tag:cloud}
{/exp:low_search:filters}
2
  • Which issue you are facing with above code? Commented Mar 22, 2017 at 11:39
  • Thanks for your response. When I check filter checkboxes they don't modify the query in the URL.
    – wjp
    Commented Mar 23, 2017 at 7:05

1 Answer 1

0

If you're using form elements like checkboxes, use the Form tag rather than the Filters tag. This will generate a <form> element around the checkboxes. You can then use JavaScript to submit the form when a checkbox is (un)checked.

Alternatively, you can use the Filters tag together with the (short syntax) URL tag to create a list of links rather than checkbox elements, which will just generate URLs instead of a form.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.