From 902acfbdbcc1d59941399753e887479e586e2748 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 26 Mar 2017 23:16:28 +0200 Subject: Improve form validation - Trim names - Income amount accepted from 0 - Validate colors --- src/client/Dialog/AddPayment/View.elm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/client/Dialog/AddPayment') diff --git a/src/client/Dialog/AddPayment/View.elm b/src/client/Dialog/AddPayment/View.elm index 078d5b7..66c9f00 100644 --- a/src/client/Dialog/AddPayment/View.elm +++ b/src/client/Dialog/AddPayment/View.elm @@ -86,10 +86,10 @@ submitForm categories paymentCategories addPayment = Just paymentId -> Msg.Dialog <| Dialog.UpdateAndClose - <| Msg.EditPayment paymentId data.name data.cost data.date data.category data.frequency + <| Msg.EditPayment paymentId (String.trim data.name) data.cost data.date data.category data.frequency Nothing -> Msg.Dialog <| Dialog.UpdateAndClose - <| Msg.CreatePayment data.name data.cost data.date data.category data.frequency + <| Msg.CreatePayment (String.trim data.name) data.cost data.date data.category data.frequency Nothing -> Msg.Dialog <| Dialog.Update <| DialogMsg.AddPaymentMsg categories paymentCategories <| Form.Submit -- cgit v1.2.3