Saving a multiple select as attribute

Currently running into a issue where my multiple selects are being saved in the attribute.

Is there a certain want you have to format the array to save it correctly for C5 to pick it up?

<div class="form-group col-md-12">
    <?= $form->label('pageTypeOfColors[]',t('Type of Colors'));?>
    <select multiple id='pageTypeOfColors' name='pageTypeOfColors[]' class="form-control">
        <?php foreach($pageTypeOfColors as $i=>$j) {
            if(is_array($pageTypeOfColorsSaved) && in_array($i,$pageTypeOfColorsSaved))
                echo "<option selected value=".$i.">".$j."</option>";
                echo "<option value=".$i.">".$j."</option>";

public function view()
    // getting select options
    $ak = CollectionAttributeKey::getByHandle('type_of_Colors');
    $akc = $ak->getController();
    $values = $akc->getOptions();
    $typeOfColors = array();
    foreach($values as $v)
        $typeOfColors[$v->getSelectAttributeOptionID()] = $v->getSelectAttributeOptionValue();
    $this->set('pageTypeOfColors', $typeOfColors)
    // saved color from database for later editing.

View Replies:
MrKDilkington replied on at Permalink Reply
Hi Heihachi,

This tutorial discusses how to use the Select Multiple form widget: