Skip to main content
io.select.multiple() asks to pick several options and returns their values. The drop-down and the chosen options sit in one frame: each pick is listed under the drop-down, one per row, and the × on its right takes it back. Provided by the @awaitio/select-multiple package.
A Multiple choice frame with the Add… drop-down on top and Email and SMS in rows under it, each with a × on the right

Install

Setup

Register it under the key you want in io, see Input components:
app.ts

Usage

Props

Optional

The field is required. Chain .optional() to let it stay empty; the handler then gets string[] | undefined, see Optional fields.

Returns

string[]: the chosen options’ values, in the order of the options, not the order they were picked.

Built-in validation

The server checks every answer, so a crafted request cannot slip in other values:

Custom validation

Chain .validate() for a check of your own. It runs on the server after the checks above, gets the value the handler would get and returns a message to show under the field, or nothing when the value is fine; see Custom validation.