Skip to main content
io.select.multiple() asks to pick several options and returns the chosen options themselves: { value, label } objects, enum members or records from your database. 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 Tell them by 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

Options can be records, identified and named by key and label; the defaults can be their keys:
The options stay on the server; the browser gets only their labels and answers with the positions of the chosen ones.

Props

Optional

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

Returns

The chosen options themselves, typed by options, 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.