reform-blaze-0.1: Add support for using blaze-html with Reform

Safe HaskellSafe-Infered

Text.Reform.Blaze.Common

Synopsis

Documentation

inputText :: (Monad m, FormError error, ToValue text) => (input -> Either error text) -> text -> Form m input error Html () textSource

inputPassword :: (Monad m, FormError error, ToValue text) => (input -> Either error text) -> text -> Form m input error Html () textSource

inputSubmit :: (Monad m, FormError error, ToValue text) => (input -> Either error text) -> text -> Form m input error Html () (Maybe text)Source

inputReset :: (Monad m, FormError error, ToValue text) => text -> Form m input error Html () ()Source

inputHidden :: (Monad m, FormError error, ToValue text) => (input -> Either error text) -> text -> Form m input error Html () textSource

inputButton :: (Monad m, FormError error, ToValue text) => text -> Form m input error Html () ()Source

textareaSource

Arguments

:: (Monad m, FormError error, ToMarkup text) 
=> (input -> Either error text) 
-> Int

cols

-> Int

rows

-> text

initial text

-> Form m input error Html () text 

inputFile :: (Monad m, FormError error, FormInput input, ErrorInputType error ~ input) => Form m input error Html () (FileType input)Source

Create an <input type="file"> element

This control may succeed even if the user does not actually select a file to upload. In that case the uploaded name will likely be "" and the file contents will be empty as well.

buttonSubmit :: (Monad m, FormError error, ToValue text, ToMarkup children) => (input -> Either error text) -> text -> children -> Form m input error Html () (Maybe text)Source

Create a <button type="submit"> element

buttonReset :: (Monad m, FormError error, ToMarkup children) => children -> Form m input error Html () ()Source

create a <button type="reset"></button> element

This element does not add any data to the form data set.

button :: (Monad m, FormError error, ToMarkup children) => children -> Form m input error Html () ()Source

create a <button type="button"></button> element

This element does not add any data to the form data set.

label :: (Monad m, ToMarkup children) => children -> Form m input error Html () ()Source

create a <label> element.

Use this with ++ or ++ to ensure that the for attribute references the correct id.

 label "some input field: " ++> inputText ""

inputCheckboxSource

Arguments

:: forall x error input m . (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) 
=> Bool

initially checked

-> Form m input error Html () Bool 

Create a single <input type="checkbox"> element

returns a Bool indicating if it was checked or not.

see also inputCheckboxes FIXME: Should this built on something in Generalized?

inputCheckboxesSource

Arguments

:: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToMarkup lbl) 
=> [(a, lbl)]

value, label, initially checked

-> (a -> Bool)

function which indicates if a value should be checked initially

-> Form m input error Html () [a] 

Create a group of <input type="checkbox"> elements

inputRadioSource

Arguments

:: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToMarkup lbl) 
=> [(a, lbl)]

value, label, initially checked

-> (a -> Bool)

isDefault

-> Form m input error Html () a 

Create a group of <input type="radio"> elements

selectSource

Arguments

:: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToMarkup lbl) 
=> [(a, lbl)]

value, label

-> (a -> Bool)

isDefault, must match *exactly one* element in the list of choices

-> Form m input error Html () a 

create <select></select> element plus its <option></option> children.

see also: selectMultiple

selectMultipleSource

Arguments

:: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToMarkup lbl) 
=> [(a, lbl)]

value, label, initially checked

-> (a -> Bool)

isSelected initially

-> Form m input error Html () [a] 

create <select multiple="multiple"></select> element plus its <option></option> children.

This creates a <select> element which allows more than one item to be selected.

errorList :: (Monad m, ToMarkup error) => Form m input error Html () ()Source

create a <ul> which contains all the errors related to the Form.

The \ul\ will have the attribute class="reform-error-list".

childErrorList :: (Monad m, ToMarkup error) => Form m input error Html () ()Source

create a <ul> which contains all the errors related to the Form.

Includes errors from child forms.

The \ul\ will have the attribute class="reform-error-list".

br :: Monad m => Form m input error Html () ()Source

create a <br> tag.

fieldset :: (Monad m, Functor m) => Form m input error Html proof a -> Form m input error Html proof aSource

wrap a <fieldset class="reform"> around a Form

ol :: (Monad m, Functor m) => Form m input error Html proof a -> Form m input error Html proof aSource

wrap an <ol class="reform"> around a Form

ul :: (Monad m, Functor m) => Form m input error Html proof a -> Form m input error Html proof aSource

wrap a <ul class="reform"> around a Form

li :: (Monad m, Functor m) => Form m input error Html proof a -> Form m input error Html proof aSource

wrap a <li class="reform"> around a Form

formSource

Arguments

:: ToValue action 
=> action

action url

-> [(String, String)]

hidden fields to add to form

-> Html

children

-> Html 

create <form action=action method="POST" enctype="multipart/form-data">