Hey guys,
This is actually a PHP-ism. Whenever you have a single form field name that's being used to submit multiple values, e.g. a multi-select dropdown or a series of checkboxes, you need to tack on the characters "[]" to the end of the name attribute to let the server know. Here's how the HTML would look:
Hope this helps!
- Ben
This is actually a PHP-ism. Whenever you have a single form field name that's being used to submit multiple values, e.g. a multi-select dropdown or a series of checkboxes, you need to tack on the characters "[]" to the end of the name attribute to let the server know. Here's how the HTML would look:
Code:
<select name="myfield[]" multiple size="3">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<input type="checkbox" name="myfield2[]" value="1" /> 1
<input type="checkbox" name="myfield2[]" value="2" /> 2
<input type="checkbox" name="myfield2[]" value="3" /> 3
<input type="checkbox" name="myfield2[]" value="4" /> 4
Hope this helps!
- Ben