summaryrefslogtreecommitdiff
path: root/elm/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'elm/Lib')
-rw-r--r--elm/Lib/Html.elm8
1 files changed, 8 insertions, 0 deletions
diff --git a/elm/Lib/Html.elm b/elm/Lib/Html.elm
index 6e67cefb..86c0f8f7 100644
--- a/elm/Lib/Html.elm
+++ b/elm/Lib/Html.elm
@@ -31,6 +31,14 @@ br_ : Int -> Html m
br_ n = if n == 1 then br [] [] else span [] <| List.repeat n <| br [] []
+-- Quick short-hand way of creating a form that can be disabled.
+-- Usage:
+-- form_ Submit_msg (state == Disabled) [contents]
+form_ : msg -> Bool -> List (Html msg) -> Html msg
+form_ sub dis cont = Html.form [ onSubmit sub ]
+ [ fieldset [disabled dis] cont ]
+
+
inputButton : String -> m -> List (Attribute m) -> Html m
inputButton val onch attrs =
input ([ type_ "button", class "submit", tabindex 10, value val, onClick onch] ++ attrs) []