J
J
jww2018-02-19 23:12:34
Web development
jww, 2018-02-19 23:12:34

How to save the state of checkboxes and selects?

Good day. How to save the value of checkboxes and selects when switching between pages? Cookies, localstorage are not suitable because you need the ability to send links to pages. There are no problems with inputs. All values ​​are in the $_GET array
5a8b2fb01a779291823003.jpeg

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vyacheslav Shevchenko, 2018-02-19
@jww

<input <?= $_GET["checkboxname"] == "Y" ? "checked='checked'" : "" ?> type='checkbox' name='checkboxname' value='Y'>

Try this. If the checkbox has a value, then it is passed if the checkbox is checked. I typed the code right here, I can be sealed up somewhere, it seems like it should work.

T
tyzberd, 2018-02-19
@tyzberd

change the url when choosing options. And when you click on the link, parse it and mark the selected values.

V
Vladimir, 2018-02-19
@djQuery

In session

P
PEREGINEC, 2018-02-19
@PEREGINEC

In session x2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question