Page is a not externally linkable
- Code, Content, and Presentation
-- HTML
---- Naming Checkboxes in Forms


Fotiman - 3:49 pm on Aug 3, 2011 (gmt 0)


You need to give the input a name ending in []. As in:


<input type="checkbox" name="CURRENT-vendor[]" id="companyA" value="companyA" />
<label for="companyA">Company A</label>

<input type="checkbox" name="CURRENT-vendor[]" id="companyB" value="companyB" />
<label for="companyB">Company B</label>

Then you will be able to treat the result as an array in PHP. Like so:

<?php
print_r($_POST['CURRENT-vendor']);
?>


Thread source:: http://www.webmasterworld.com/html/4347195.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com