我使用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
感謝您的幫助。