maximum length of 100 for all inputs

This commit is contained in:
Jack Wines 2023-06-11 07:55:12 -07:00
parent 583506df02
commit ad73073f1d

View file

@ -30,7 +30,6 @@ import qualified System.Environment as S
staticFolderLoc = "../client/static"
getPollForBallot :: P.PollId -> AppM P.CreatePollInfo
getPollForBallot pollId = do
db <- Rd.asks db
@ -92,7 +91,7 @@ pageHead = head_ $ do
optionInput :: L.Html ()
optionInput = div_ $
input_ [required_ "true", name_ "options"] <>
input_ [required_ "true", name_ "options", maxlength_ "100"] <>
with button_ [classes_ ["btn", "btn-warning-outline"], hxGet_ "create/removeInput", hxSwap_ "delete", hxTarget_ "closest #options-create > *"] "remove"
createPage :: AppM (L.Html ())
@ -101,8 +100,8 @@ createPage = pure $ do
with body_ [classes_ ["container", "container-sm", "paper"], hxExt_ "json-enc"] $ do
h2_ "create a poll"
with form_ [id_ "inputs", hxPost_ "/create", hxTarget_ "body"] $ do
with label_ [for_ "title"] "title (optional)" <> input_ [name_ "title", type_ "text"]
with label_ [for_ "question"] "question" <> input_ [name_ "question", type_ "text", required_ "true"]
with label_ [for_ "title"] "title (optional)" <> input_ [name_ "title", type_ "text", maxlength_ "100"]
with label_ [for_ "question"] "question" <> input_ [name_ "question", type_ "text", required_ "true", maxlength_ "100"]
with fieldset_ [name_ "options", id_ "options-create"] $ do
legend_ "options"
optionInput