Get Input from a Form

Enter some data and click the Submit button. The request gives you an innocent stare and displays “No server” because you are not running the server on your machine.

This example show how to use a form to collect data from a user.

A form usually contains several input elements for entering data of various kinds, such as names and addresses, birthdays, email addresses, and so on. HTML supports several kinds of input elements, including text fields, text areas, radio buttons, and checkboxes. HTML5 adds more specialized input elements such as email and password fields, color pickers, date and time widgets, and range elements.

A form has an action, which is a URL to which to send the form data, and a method, which indicates how the form data is to be sent. The action and the method can be specified declaratively within HTML, or you can write Dart code and use Dart libraries to perform the action programmatically.

Read this tutorial for more detail, or read the source.

See all samples.