`required' attribute for nicHtmlField (textfield tag)

This commit is contained in:
Dunric 2014-08-20 01:53:59 +02:00
parent 9831220c47
commit d4175f11cc

View File

@ -26,10 +26,10 @@ class Yesod a => YesodNic a where
nicHtmlField :: YesodNic site => Field (HandlerT site IO) Html
nicHtmlField = Field
{ fieldParse = \e _ -> return . Right . fmap (preEscapedToMarkup . sanitizeBalance) . listToMaybe $ e
, fieldView = \theId name attrs val _isReq -> do
, fieldView = \theId name attrs val isReq -> do
toWidget [shamlet|
$newline never
<textarea id="#{theId}" *{attrs} name="#{name}" .html>#{showVal val}
<textarea id="#{theId}" *{attrs} name="#{name}" :isReq:required .html>#{showVal val}
|]
addScript' urlNicEdit
master <- getYesod