S
S
Sergey Beloventsev2016-05-08 21:56:24
Yii
Sergey Beloventsev, 2016-05-08 21:56:24

How to hang PJAX on checkBox selection?

there is a form, it is displayed by widgets, so I show it in the implemented state

<form id="ajaxForm" action="/" method="post">
        <input type="hidden" name="_csrf" value="cEM3LWFYWWE4BXNPUwIAUBImGh8PbA8wLyROYjEcL1lGC29.JwkcIA==">                            
        <div class="col-lg-2 col-md-2">
            <ul>
                <li>
                    <span class="niceCheck">
                        <input type="checkbox" data-userId="" name="ch1" value="1" />
                    </span>ужасы
                </li>
                <li>
                    <span class="niceCheck">
                        <input type="checkbox" data-userId="" name="ch1" value="2" />
                    </span>фантастика 
                </li>
                <li>
                    <span class="niceCheck">
                        <input type="checkbox" data-userId="" name="ch1" value="3" />
                    </span>триллер 
                </li>
                        <li>
                            <span class="niceCheck">
                                <input type="checkbox" data-userId="" name="ch1" value="4" />
                            </span>драма
                        </li>
                       <li>
                           <span class="niceCheck">
                               <input type="checkbox" data-userId="" name="ch1" value="5" />
                           </span>мелодрама 
                      </li>
                </ul>
        </div>
        <div class="colfd"> Найдено 20 сериалов </div>
        <button type="submit" class="svbn">Показать</button> 
    </form>

Is it possible to configure so that when the checkbox is selected, a pjax request would be sent and changed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2016-05-11
@karminski

Pjax is easy to attach to a form. And the form can be submitted by changing the state of the checkbox.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question