B
B
blackbb2019-05-10 13:47:43
MODX
blackbb, 2019-05-10 13:47:43

How to filter objects with checkboxes in modx revo?

Hello, tell me how to make a selection using checkboxes in this filter https://webdesign-master.ru/blog/modx/2016-05-03-m... ?
Here is the site https://xn----7sbekednhg2bbf3az6l.xn--p1ai/ where I implemented this filter, it is under the banner in the header, you need to implement a selection using the checkbox so that you can select all types of objects, I tried options like in the example on the filter site. Checkboxes work, but the filter itself still returns objects of only the last type of object clicked in the filter.
I write this in a snippet

// Шапка: чекбоксы "Тип объекта"
if($_GET['type_obj']) {
  $filter[type_obj] = $_GET['type_obj'];
}

My template code
<div class="search_type">
              <div class="search_title">
                Тип объекта:
              </div>
              <div id="type_list">
                <div class="type_one">
                   <label for="garage">
                      <input class="del_chek_attr" id="garage" type="checkbox" name="type_obj" value="1"   ><span>Аренда</span>
                   </label>	
                </div>
                
                <div class="type_one">
                   <label for="garagetwo" >
                      <input class="del_chek_attr" id="garagetwo" type="checkbox" name="type_obj" value="2"  ><span>Собственность</span>
                   </label>	
                </div>

                <div class="type_one">
                   <label for="garagethree">
                      <input class="del_chek_attr" id="garagethree" type="checkbox" name="type_obj" value="3"  ><span>Доходный дом</span>
                   </label>
                </div>


              </div>
            </div>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question