~ben/yesod-text-markdown

29d482d46eab8bc583a833e99373539298daed72 — Arash Rouhani 7 years ago 173f1b8 + 6f3e7de
Merge pull request #8 from MaxGabriel/patch-2

Set the `required` attribute on the textarea if applicable
1 files changed, 2 insertions(+), 2 deletions(-)

M Yesod/Text/Markdown.hs
M Yesod/Text/Markdown.hs => Yesod/Text/Markdown.hs +2 -2
@@ 37,9 37,9 @@ instance FromJSON Markdown where
markdownField :: (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Markdown
markdownField = Field
    { fieldParse = parseHelper $ Right . Markdown . fromStrict
    , fieldView = \theId name attrs val _isReq -> toWidget
    , fieldView = \theId name attrs val isReq -> toWidget
        [hamlet|$newline never
<textarea id="#{theId}" name="#{name}" *{attrs}>#{either id extractStrict val}
<textarea id="#{theId}" name="#{name}" :isReq:required="" *{attrs}>#{either id extractStrict val}
|]
   , fieldEnctype = UrlEncoded -- I choose UrlEncoded because textareaField is
     }