Z
Z
zuraavl2018-10-23 03:32:14
JavaScript
zuraavl, 2018-10-23 03:32:14

How to move checkbox states to new page?

I ran into a problem in the Perfect WooCommerce Brands plugin
. When I embed a widget with a filter, its active states are not displayed.
For example:

<h3 class="widget-title">Бренды</h3>
<div class="pwb-filter-products pwb-hide-submit-btn" data-cat-url="/zhenskoe/">
  <ul>
          <li>
        <label>
          <input type="checkbox" data-brand="48" value="ambush">AMBUSH</label>
      </li>
          <li>
        <label>
          <input type="checkbox" data-brand="51" value="helmut-lang">HELMUT LANG </label>
      </li>
          <li>
          ...

When I select a brand, the page reloads and I can't style the active checkbox. It is not distinguished in any way, it is not marked.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
V Sh., 2018-10-23
@JuniorNoobie

If you make a filter and want to pass it somewhere, for example, to another person by copying a link, then you should store the states in the address bar as a parameter. Example: demo.com?mychecker=1.
Then, on this page, build and filter what you need, extracting information from the address bar.

A
Alexander, 2018-10-23
@NeiroNx

Store its state in localstorage when it changes, and set values ​​from localstorage on page load.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question