我使用Elm表https://github.com/etaque/elm-form,但我无法弄清楚两个字段的验证,我想验证密码和密码确认字段是否匹配。验证Elm和Elm-Form中的两个字段
这是我到目前为止有:
validate : Validation String RegUser
validate =
map6 RegUser
(field "email" email)
(field "password" (string |> andThen nonEmpty))
(field "passwordConfirmation" (string |> andThen nonEmpty))
(field "firstName" (string |> defaultValue ""))
(field "lastName" (string |> defaultValue ""))
(field "companyName" (string |> defaultValue ""))
整个代码:https://github.com/werner/madison-elm/blob/master/src/elm/Components/Register/Models.elm
感谢您的帮助。