Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #8 from MaxGabriel/patch-2
Set the `required` attribute on the textarea if applicable
  • Loading branch information
Tarrasch committed Oct 11, 2014
2 parents 173f1b8 + 6f3e7de commit 29d482d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Yesod/Text/Markdown.hs
Expand Up @@ -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
}
Expand Down

0 comments on commit 29d482d

Please sign in to comment.