I have following checkbox arrays in html form
<label><input name="columns[]" type="checkbox" value="pname" />Property Name</label>
<label><input name="columns[]" type="checkbox" value="2000" />Price</label>
<label><input name="columns[]" type="checkbox" value="New Road" />Location</label>
<label><input name="columns[]" type="checkbox" value="Joe Smith" />Owner</label>
there are about 30 such checkboxes.
All i want to do is sending the text along with its value of the checked box while form is posted. Lets say if i checked first checkbox, I want to send pname along with text Property Name. There can be several solutions for this, but don’t know which one will be easier one.
The one I thought is. In submit page iterating through the loop of checkbox array, create another array and Push the text manually to this new array.
Or other option I have thought is, in value attribute I will send text with value like this pname^Property Name and in submit page i iterate through loop, explode the value and put them to respective arrays.
Is there any alternative solution for this?
Thanks
HTML
PHP