From 76d101b58f1ea60ed9fe130718ba1bae39458bca Mon Sep 17 00:00:00 2001 From: quidtum Date: Mon, 7 Dec 2020 18:07:14 -0500 Subject: require form input --- src/Lib.hs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Lib.hs b/src/Lib.hs index 517a8d0..ca879f7 100644 --- a/src/Lib.hs +++ b/src/Lib.hs @@ -46,10 +46,6 @@ import Servant.HTML.Lucid import System.Random.Stateful import Web.FormUrlEncoded --- TODO --- nginx rate limiting --- stats report exe? - newtype DomainIden = DomainIden Integer deriving (FromField, FromHttpApiData, ToHttpApiData, ToField) newtype LineIden = LineIden Integer deriving (Eq, Ord, FromField, FromHttpApiData, ToHttpApiData, ToField, Generic, Num) newtype Color = Color T.Text deriving (FromField, ToHttpApiData, ToField) @@ -636,7 +632,7 @@ instance ToHtml DomainWriteView where Nothing -> div_ "" div_ $ do label_ [for_ "txt", class_ "focus"] "your line: " - input_ [type_ "text", name_ "txt", id_ "txt", value_ "", maxlength_ "100"] + input_ [type_ "text", name_ "txt", id_ "txt", value_ "", maxlength_ "120", required_ "1"] div_ $ do label_ [for_ "color", class_ "focus"] "your color: " input_ [type_ "color", name_ "color", id_ "color", value_ ("#" <> color)] @@ -647,7 +643,7 @@ instance ToHtml DomainWriteView where span_ $ toHtml (DomainedLine domainName dst) Nothing -> div_ "" div_ $ - button_ [type_ "submit"] "Submit" + input_ [type_ "submit", value_ "Submit"] ) toHtmlRaw = toHtml -- cgit v1.2.3