yesod-form-1.4.0.2: Form handling support for Yesod Web Framework

Safe HaskellNone

Yesod.Form.Fields

Contents

Synopsis

i18n

Fields

intField :: (Monad m, Integral i, RenderMessage (HandlerSite m) FormMessage) => Field m iSource

timeField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m TimeOfDaySource

type AutoFocus = BoolSource

parseDate :: String -> Either FormMessage DaySource

parseTime :: Text -> Either FormMessage TimeOfDaySource

newtype Textarea Source

A newtype wrapper around a Text that converts newlines to HTML br-tags.

Constructors

Textarea 

Fields

unTextarea :: Text
 

checkBoxField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m BoolSource

While the default boolField implements a radio button so you can differentiate between an empty response (Nothing) and a no response (Just False), this simpler checkbox field returns an empty response as Just False.

Note that this makes the field always optional.

File AForms

Options

selectField :: (Eq a, RenderMessage site FormMessage) => HandlerT site IO (OptionList a) -> Field (HandlerT site IO) aSource

selectFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, a)] -> Field (HandlerT site IO) aSource

radioField :: (Eq a, RenderMessage site FormMessage) => HandlerT site IO (OptionList a) -> Field (HandlerT site IO) aSource

radioFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, a)] -> Field (HandlerT site IO) aSource

checkboxesFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, a)] -> Field (HandlerT site IO) [a]Source

checkboxesField :: (Eq a, RenderMessage site FormMessage) => HandlerT site IO (OptionList a) -> Field (HandlerT site IO) [a]Source

multiSelectField :: (Eq a, RenderMessage site FormMessage) => HandlerT site IO (OptionList a) -> Field (HandlerT site IO) [a]Source

multiSelectFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, a)] -> Field (HandlerT site IO) [a]Source

data OptionList a Source

Constructors

OptionList 

Fields

olOptions :: [Option a]
 
olReadExternal :: Text -> Maybe a
 

optionsPersistKey :: (YesodPersist site, PersistEntity a, PersistQuery (PersistEntityBackend a), PathPiece (Key a), RenderMessage site msg, YesodPersistBackend site ~ PersistEntityBackend a) => [Filter a] -> [SelectOpt a] -> (a -> msg) -> HandlerT site IO (OptionList (Key a))Source

An alternative to optionsPersist which returns just the Key instead of the entire Entity.

Since 1.3.2

optionsPairs :: (MonadHandler m, RenderMessage (HandlerSite m) msg) => [(msg, a)] -> m (OptionList a)Source

optionsEnum :: (MonadHandler m, Show a, Enum a, Bounded a) => m (OptionList a)Source