Optgroup Get In Php Label Associated
I have following code in a html form
Solution 1:
Indeed, you only get the value. If you need more, just encode whatever you want into the value, for example:
<option value="Item3.SubItem5">SubItem5</option>
Alternatively, you could use javascript to catch onChange
events on the select
field and update a hidden input field with the desired label.
Solution 2:
you could make the values arrays e.g.
<option value="Item3[SubItem5]">SubItem5</option>
so then your $_POST['category'] should return an array
Post a Comment for "Optgroup Get In Php Label Associated"