When a user submits an HTML form to your app, the data is available
from the request.params object, which has a property for
each form parameter. The property value is a string, or an array if
the property value occurs more than once.
Here's a form with a single text box. When the user presses "enter" in the text box, the form submits back to the app. The app always shows the form, but if it detects form data, it shows that below the form.
Note that the action is the URL to submit the form to,
and method:"post" tells the form how to send the
data. (The alternative is "get", which would also work here, but would
encode the form data into the URL.)
Here's a similar app that uses the "dispatch" library. Submitting the form takes the user to a different page, from which they can click a link to return.
Here's a more complicated app that implements Elmer Fudd's speech impediment. It uses our "quickforms" library, an experimental library that makes it a little easier to format forms.
The steps to using a QuickForm are creating it, adding fields, and
printing it. Each field has an "id" (the first argument), which is
mainly used to give each input field a parameter name so you can refer to it
through request.params.