The <form> Tag

Place a form anywhere inside the body of a document, with its elements enclosed by the <form> tag and its respective end tag (</form>). You can, and we recommend you often do, include regular body content inside a form to specially label user-input fields and to provide directions.

Browsers flow the special form elements into the containing paragraphs as though they were small images embedded into the text. There aren't any special layout rules for form elements, so you need to use other elements, such as tables and stylesheets, to control the placement of elements within the text flow.

You must define at least two special form attributes, which provide the name of the form's processing server and the method by which the parameters are to be sent to the server. A third, optional attribute lets you change how the parameters get encoded for secure transmission over the network.

The action Attribute

The required action attribute for the <form> tag gives the URL of the application that is to receive and process the form's data. Most webmasters keep their forms-processing applications in a special directory on their web server, usually named ...

Get HTML & XHTML: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.