Hi,
> I'm attaching a simple example for select. I'll post an example
> with tables momentarily.
It seems the Ocaml_beginners group swallows attachments. Here's
the select example, again:
Cheers,
Dario Teixeira
================================================================
open XHTML.M
let coucou_handler _ selection () =
Lwt.return
(html
(head (title (pcdata "Results")) [])
(body [p [ pcdata ("You sent: " ^ selection)]]))
let coucou_service =
Eliom_predefmod.Xhtml.register_new_service
~path: ["coucou"]
~get_params: (Eliom_parameters.string "selection")
coucou_handler
let coucou_form enter_selection =
[
fieldset
[
Eliom_predefmod.Xhtml.string_select ~name:enter_selection
(Eliom_predefmod.Xhtml.Option ([], "one", Some (pcdata "um"), false))
[
Eliom_predefmod.Xhtml.Option ([], "two", Some (pcdata "dois"), false);
Eliom_predefmod.Xhtml.Option ([], "three", Some (pcdata "trĂªs"), false);
];
Eliom_predefmod.Xhtml.string_input ~input_type:`Submit ~value:"Send" ()
]
]
let main_handler sp () () =
let myform = Eliom_predefmod.Xhtml.get_form coucou_service sp coucou_form in
Lwt.return
(html
(head (title (pcdata "")) [])
(body [p [pcdata "Form for coucou:"]; myform]))
let main_service =
Eliom_predefmod.Xhtml.register_new_service
~path: [""]
~get_params: Eliom_parameters.unit
main_handler