Diar Selimi Diar Selimi - 2 months ago 4
HTML Question

How do i save all the values from the checkbox and drop lists

So i have this problem i have 6 columns with n check boxes in columns,

<ul>
<li>
<input type="checkbox" name="kuche[]" id="check" value="freie Falächen reinigen / abstauben">
<label for="check"></label>
<p>freie Falächen reinigen / abstauben</p>
<div class="rutina"></div>
</li>
<li>
<input type="checkbox" name="kuche[]" id="check" value="Griffspuren allg. entfernen"> <label for="check"></label><label for="check"></label>
<p>Griffspuren allg. entfernen</p>
<div class="rutina"></div>
</li>
<li>
<input type="checkbox" name="kuche[]" id="check" value="Türen vollflächig reinigen"> <label for="check"></label>
<p>Türen vollflächig reinigen</p>
<div class="rutina"></div>
</li>
<li>
<input type="checkbox" name="kuche[]" id="check" value="Lavabo reinigen /entkalken"> <label for="check"></label>
<p>Lavabo reinigen /entkalken</p>
<div class="rutina"></div>
</li>
<li>
<input type="checkbox" name="kuche[]" id="check" value="Spinnweben entfernen"> <label for="check"></label>
<p>Spinnweben entfernen</p>
<div class="rutina"></div>
</li>
<li>
<input type="checkbox" name="kuche[]" id="check" value="nass aufnehmen"> <label for="check"></label>
<p>nass aufnehmen</p>
<div class="rutina"></div>
</li>
</ul>


so this is one of the columns or the list there are 6 these , and when i click each of the check boxes in the div.rutina it will appear the drop down list when the checkbox is checked, here is the link for the live view : example

So the problem here is how do i get all the values of dropdown list for each checkbox in the each column when i submit the form.

Answer

As @Sean wrote the solution would be more or less like that, but i forgot to add it in that time when i had this problem sorry, i would give the added inputs the name ex: dropdown[] and then for each checkbox selected i would have also a dropdown so with a foreach loop i could save all the elements,

foreach($_POST['checkbox'] as $key => $value) {
    //value would be here for checkbox
    $value;
    //the value for dropdown would be here 
    $drop = $_POST['dropdows'][$key];

More or less this would be the solution.