From fe56ddfbd14b3e7fbaee8732641bcc00fbd0c856 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Thu, 30 Jul 2020 17:23:24 +0200 Subject: Forms wtf --- client/src/Client.elm | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'client') diff --git a/client/src/Client.elm b/client/src/Client.elm index aa2121c..1938711 100644 --- a/client/src/Client.elm +++ b/client/src/Client.elm @@ -51,16 +51,22 @@ view model = case model of (\p -> Html.li [] [Html.text p]) game.view.opponents , Html.h1 [] [Html.text "You"] - , Html.input - [ Html.Attributes.value game.changeMyName - , Html.Events.onInput ChangeMyName + , Html.form + [ Html.Attributes.action "" + , Html.Events.onSubmit SubmitMyName ] - [] - , Html.button - [ Html.Events.onClick SubmitMyName - , Html.Attributes.disabled <| game.view.myName == game.changeMyName + [ Html.input + [ Html.Attributes.value game.changeMyName + , Html.Events.onInput ChangeMyName + ] + [] + , Html.button + [ Html.Attributes.type_ "submit" + , Html.Attributes.disabled <| + game.view.myName == game.changeMyName + ] + [Html.text "change"] ] - [Html.text "change"] ] subscriptions : Model -> Sub Msg -- cgit v1.2.3