Added intInput
This commit is contained in:
parent
2391995622
commit
4b2b14e3ac
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user