Commit 5e660610 authored by Benoit Barbot's avatar Benoit Barbot
Browse files

add id

parent d73325b8
Pipeline #2235 passed with stage
in 34 seconds
......@@ -365,7 +365,8 @@ module GraphEditor (G : GRAPH) = struct
[
txt "Load file: ";
(*input ~a:[a_id "filein"; a_input_type `File; a_onchange (change_file loadfile)] ();*)
text_input ~_type:"file" ~on_change:(change_file loadfile) "";
text_input ~_type:"file" ~id:"filein"
~on_change:(change_file loadfile) "";
choice_input ~init_value:(Some "Download")
~on_change:(fun x -> (List.assoc x dl) ())
(List.map fst dl);
......
......@@ -112,12 +112,13 @@ let check_input ?(class_ = "") ?(on_change = fun _ -> true) value =
input##.className := Js.string class_;
(input :> t)
let text_input ?(class_ = "") ?(on_change = fun _ -> true) ?(_type = "text")
value =
let text_input ?(class_ = "") ?(id = "") ?(on_change = fun _ -> true)
?(_type = "text") value =
(*let input2 = input ~a:[a_input_type `Text] () in
let input = Eliom_content.Html.To_dom.of_input input2 in*)
let input = Dom_html.(createInput ~_type:(Js.string _type) document) in
input##.value := Js.string value;
input##.id := Js.string id;
let on_input _ =
let res = on_change (Js.to_string input##.value) in
if res then input##.style##.color := Js.string "green"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment