Skip to main content

MultiSelect

MultiSelect widgetMultiSelect widget

Multiple choice from a checkbox list. It collects a list<string> of the checked values, in display order.

$p->multiSelect('basket', 'Basket')
->options([
'apple' => 'Apple',
'carrot' => 'Carrot',
'tomato' => 'Tomato',
])
->default(['apple']) // Values pre-checked when the field opens.
->pageSize(10); // Options visible before the list pages around the cursor.

Options

NameDescriptionRequiredDefault
options()The choices, as a value => label map (or added one at a time with option()).Yes-
default()Values pre-checked when the field opens - ideal for opt-out lists.No[] (none)
pageSize()Options shown before the list pages around the cursor.No10

Type to narrow the list by substring. For headings, separators and disabled options, see Option groups.

Keyboard

KeyAction
/ Move the highlight
SpaceToggle the highlighted option
/ Select all / deselect all visible
printable keysFilter the list by substring
BackspaceDelete a filter character
EnterAccept the checked set
EscCancel

Display modes

In all four display modes - Unicode or ASCII, colour on or off:

ANSINo ANSI
UnicodeMultiSelect: Unicode + ANSIMultiSelect: Unicode + ANSIMultiSelect: Unicode + No ANSIMultiSelect: Unicode + No ANSI
ASCIIMultiSelect: ASCII + ANSIMultiSelect: ASCII + ANSIMultiSelect: ASCII + No ANSIMultiSelect: ASCII + No ANSI