------------ HTML Form ------------ HTML
------------- The HTML element defines a form that is used to collect user input: .. code-block:: html :linenos:

HTML Forms

First name:

Last name:

If you click the "Submit" button, the form-data will be sent to a page called "/action_page.php".

The Element ------------------- The element is the most important form element. The element can be displayed in several ways, depending on the type attribute. Here are some examples: +------------------------+--------------------------------------------------------------+ | Type | Description | +========================+==============================================================+ | | Defines a one-line text input field | +------------------------+--------------------------------------------------------------+ | | Defines a radio button (for selecting one of many choices) | +------------------------+--------------------------------------------------------------+ | | Defines a submit button (for submitting the form) | +------------------------+--------------------------------------------------------------+ Text Input ^^^^^^^^^^ defines a one-line input field for **text input**: .. code-block:: html :linenos: HTML text Input Element
First name:

Last name:
Radio Button Input ^^^^^^^^^^^^^^^^^^ defines a **radio button**. Radio buttons let a user select ONE of a limited number of choices: .. code-block:: html :linenos: HTML Radio Button Input Element
Male
Female
Other
The Submit Button ^^^^^^^^^^^^^^^^^ defines a button for **submitting** the form data to a **form-handler**. The form-handler is typically a server page with a script for processing input data. The form-handler is specified in the form's **action** attribute: .. code-block:: html :linenos: HTML Radio Button Input Element
First name:

Last name: