Answer the question
In order to leave comments, you need to log in
Passing values from checkbox?
I have multiple checkboxes on a page,
<input type="checkbox" name="person[]">
<input type="checkbox" name="person[]">
Answer the question
In order to leave comments, you need to log in
1. If by reload you mean just a reload and not a submitted form → use sessionStorage. It's just JS.
2. If you want data to come to you after submitting the form, its validation and processing, you need to have a storage of this data on the server side. Usually, this role is played by databases with users, bindings, etc., and here a great solution would be to use a framework in PL, in which there will be either forms, with which you save data in the model when loading this form again (say, editing anything), you will get a prepopulated form.
3. If you want to drive the form without any checks, simply passing data to POST \ GET, leading there with the form submission, then you need to generate a document generation using a PL that will parse the request and be able to do it tritely like this:
<input type="checkbox" checked="<?= $field[3] != true ?: 'checked' ?>">...
in order for the checkboxes not to fly off,
you can use the ajax technology, which will execute the request (send data) without reloading the page
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question