package mechaml

  1. Overview
  2. Docs

Operations on Menus (select lists)

type item

Type of an item of the list

val items : select_list input -> item list

Return all items of a given list

val is_multiple : select_list input -> bool

Check if the select list supports multiple selection

val selected : t -> select_list input -> string list

Return a list of selected items as strings

val select : t -> select_list input -> item -> t

Select a specific item. If multiple selection is not enabled, this unselect any previously selected item

val unselect : t -> select_list input -> item -> t

Unselect a specific item

val is_selected : t -> select_list input -> item -> bool

Check if the specified item is selected

val text : item -> string

Label of an item

val value : item -> string

Value (as sent in form data) of an item

val selected_default : t -> select_list input -> string list

Items with the attribute selected set

val reset : t -> checkbox input -> t

Reset the select list to its default value, meaning that only the items with the selected attribute will be selected

OCaml

Innovation. Community. Security.