Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

8. Forms > Input Forms

Input Forms

Applicative and monadic forms handle both the generation of your HTML code and the parsing of user input. Sometimes, you only want to do the latter, such as when there’s an already-existing form in HTML somewhere, or if you want to generate a form dynamically using JavaScript. In such a case, you’ll want input forms.

These work mostly the same as applicative and monadic forms, with some differences:

  • You use runInputPost and runInputGet.

  • You use ireq and iopt. These functions now only take two arguments: the field type and the name (i.e., HTML name attribute) of the field in question.

  • After running a form, it returns the value. It doesn’t return a widget or an encoding type.

  • If there are any validation errors, the page returns an “invalid arguments” error page.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial