​x
    , viewInput "password" "Re-enter Password" model.passwordAgain PasswordAgain
 
1
-- Input a user name and password. Make sure the password matches.
2
--
3
-- Read how it works:
4
--   https://guide.elm-lang.org/architecture/forms.html
5
--
6
​
7
import Browser
8
import Html exposing (..)
9
import Html.Attributes exposing (..)
10
import Html.Events exposing (onInput)
11
​
12
​
13
​
14
-- MAIN
15
​
16
​
17
main =
18
  Browser.sandbox { init = init, update = update, view = view }
19
​
20
​
21
​
22
-- MODEL
23
​
24
​
25
type alias Model =
26
  { name : String
27
  , password : String
28
  , passwordAgain : String
29
  }
30
​
31
​
32
init : Model
33
init =
34
  Model "" "" ""
35
​
36
​
37
​
38
-- UPDATE
39
​
40
​
41
type Msg
42
  = Name String
43
  | Password String
44
  | PasswordAgain String
45
​
46
​
47
update : Msg -> Model -> Model
48
update msg model =
49
  case msg of