by using Lithium form helper we can insert a select tag that a single item can be selected.
sample:
echo $this->form->field('myfield', array(
'type' => 'select',
'list' => array(
'id1' => 'value1',
'id2' => 'value2',
),
)
);
Now if you want to use Select2 jQuery plugin with multiple option, field method in form helper tries to retrieve submitted value in string.
even when multiple option is set!
non-working sample:
echo $this->form->field('myfield', array(
'type' => 'select',
'list' => array(
'id1' => 'value1',
'id2' => 'value2',
),
'multiple' => true,
)
);
fieldmethod won't accept array value in submitted forms.so try
selectmethod in Form Helper with amultipleoption.sample code: