Added intInput

This commit is contained in:
Michael Snoyman 2010-07-21 09:41:25 +03:00
parent 2391995622
commit 4b2b14e3ac

View File

@ -72,6 +72,7 @@ module Yesod.Form
-- * Pre-built inputs
, stringInput
, maybeStringInput
, intInput
, boolInput
, dayInput
, maybeDayInput
@ -308,6 +309,13 @@ instance ToFormField String where
instance ToFormField (Maybe String) where
toFormField = maybeStringField
intInput :: Integral i => String -> FormInput sub master i
intInput n =
mapFormXml fieldsToInput $
requiredFieldHelper intFieldProfile
{ fpName = Just n
} Nothing
intField :: Integral i => Html () -> Html () -> FormletField sub y i
intField l t = requiredFieldHelper intFieldProfile
{ fpLabel = l