package mechaml
Library
Module
Module type
Parameter
Class
Class type
Operations on forms and inputs
Phantom types for inputs
val name : t -> string option
Return the name of the form
val action : t -> Uri.t
Return the action attribute of the form
val uri : t -> Uri.t
Return the absolute (resolved) uri corresponding to the action attribute
val meth : t -> [ `POST | `GET ]
Return the method attribute of the form or `GET
if none
val to_node : t -> Soup.element Soup.node
Convert a form to a Soup node
val input_to_node : _ input -> Soup.element Soup.node
Convert an input to a Soup node
Set directly the value(s) of a field
Get the value(s) of a field
val get : string -> t -> string option
val get_multi : string -> t -> string list
val values : t -> (string * string list) list
Return all set values as an associative list
val iname : _ input -> string option
Return the name of an input
All the following function are built using the same pattern.
- xxxs (eg
checkboxes
) return all the inputs of a certain type as a lazy sequence. For example,checkboxes myform
will return all the checkboxes of the form - xxx_with take a CSS selector as parameter, and return the first input that matches the selector, or
None
if there isn't any. Eg,fields_with myform "[name$=text2]"
will try to find any text field which name ends withtext2
- xxxs_with proceed as the previous one, but return a lazy sequence of all inputs matching the selector.
val radio_button_with : string -> t -> radio_button input option
val radio_buttons : t -> radio_button input seq
val radio_buttons_with : string -> t -> radio_button input seq
val select_list_with : string -> t -> select_list input option
val select_lists : t -> select_list input seq
val select_lists_with : string -> t -> select_list input seq
Select textual fields, either text, password, search, or textarea
Reset or clear all the fields
module Checkbox : sig ... end
Operation on Checkboxes
module RadioButton : sig ... end
Operations on Radio Buttons
module SelectList : sig ... end
Operations on Menus (select lists)
module Field : sig ... end
Operations on general fields : textarea, text, password, color, date, etc.