[eluser]Unknown[/eluser]
Even though my multiselect has a default value, the form_validation library still says the field is required. Here's my code:
Code:
// Validation:
$this->form_validation->set_rules('product_category[]', 'Category', 'required');
// Form field:
<tr><td><?php echo form_label('Category: ', 'product-category') ?></td><td><?php echo form_multiselect('product_category[]', array('desktop' => 'Desktop Computers', 'laptop' => 'Laptop Computers', 'mobile' => 'Mobile Devices'), 'desktop', 'id="product-category"') ?></td></tr>
Am I missing something here?