Skip to content

Instantly share code, notes, and snippets.

@yetanotherion
Created April 29, 2014 19:23
Show Gist options
  • Select an option

  • Save yetanotherion/11409597 to your computer and use it in GitHub Desktop.

Select an option

Save yetanotherion/11409597 to your computer and use it in GitHub Desktop.
let create_form =
(fun (url_name, location_name) ->
let location_input = string_input ~input_type:`Text ~name:location_name () in
[p [string_input ~input_type:`Text ~name:url_name ~a:[a_onchange {{
(fun _ ->
let location = Html5.To_dom.of_element %location_input in
(Js.Unsafe.coerce location)##value <- "tome val";
Firebug.console##log("I was here");
)
}}] ();
location_input;
string_input ~input_type:`Submit ~value:"insert" ();
]
])
let _ =
Eliom_registration.Html5.register_service ["inserttest"] unit
(fun () () ->
let f = get_form ~service:insert_url_service
create_form
in
Lwt.return (html
(head (title (pcdata "Insert an url")) [])
(body [f])));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment