caption: select created: 20131024141900000 modified: 20211108165037846 tags: TriggeringWidgets Widgets title: SelectWidget type: text/vnd.tiddlywiki ! Introduction The select widget displays a popup menu based on a [[HTML select element|https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select]]. The popup (or dropdown) contains a list of items defined by `` elements. Every time the user selects a new value in the menu, the selected value is written to the text of a specified tiddler field or index and any ActionWidgets within the `actions` attribute are triggered. Conversely, if the tiddler value is changed independently the select widget is automatically updated to reflect the new value. In multiple selection mode, the list of selected values is bound to the specified tiddler field or index. Browsers generally use the ctrl or cmd keys for multiple selection. For example, this select widget displays a list of the tags in this wiki: <$macrocall $name="wikitext-example-without-html" src="<$select tiddler=<> default='HelloThere'> <$list filter='[all[shadows+tiddlers]tags[]sort[title]]'> "/> The <$link to=<>>state tiddler currently contains: <$edit-text tiddler=<> tag="input" default=""/> See the text change as you switch entries in the select widget. Try changing the value of the state tiddler and see the select widget change. Notice how the select widget only displays an entry if there is a precise match with the tiddler text. ! Content and Attributes The content of the `<$select>` widget should be one or more HTML `