Permalink
Browse files

Add selectRaw function

  • Loading branch information...
1 parent 34f9dcb commit f54a8a6eda7fb0fc9bacc6523785ce5d905ebcdb @jaspervdj jaspervdj committed Sep 26, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 Text/Blaze/Html5/Formlets.hs
@@ -11,6 +11,7 @@ module Text.Blaze.Html5.Formlets
, enumRadio
, label
, selectHtml
+ , selectRaw
, Html5Form
, Html5Formlet
, module Text.Formlets
@@ -143,3 +144,10 @@ selectHtml choices name selected =
where
applyAttrs | selected == value = (! A.selected "selected")
| otherwise = id
+
+-- | A drop-down for selecting values
+--
+selectRaw :: (Monad m)
+ => [(String, H.Html)] -- ^ Pairs of value/label
+ -> Html5Formlet m String -- ^ Resulting formlet
+selectRaw = input' . selectHtml -- todo: validate that result was in choices

0 comments on commit f54a8a6

Please sign in to comment.