diff --git a/Yesod/Form.hs b/Yesod/Form.hs index d6f08e4e..625548cc 100644 --- a/Yesod/Form.hs +++ b/Yesod/Form.hs @@ -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