HTML forms Basics

When you think about it, interacting with a web page is basically a lot of button pushing: click here, click there, go here, go therethere’s no real interactivity, and it’s certainly not personalized. Programs such as applets, servlets, JSPs, and ASPs provide extensive user-interaction capability but can be difficult to write. Forms, on the other hand, are easily made in HTML/XHTML and make it possible to create documents that collect and process user input and to formulate personalized replies.

Form Fundamentals

Forms are composed of one or more text-input boxes, clickable buttons, multiple-choice checkboxes, and even pull-down menus and image maps, all placed inside the <form> tag. You can have more than one form in a document, and within each one you also may put regular body content, including text and images. The text is particularly useful for providing form element labels, prompts, and instructions to the users on how to fill out the form.

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>).

Function Defines a form
Attributes accept, action, charset, class, dir, enctype, id, lang, method, name, onClick, onDblClick, onKeyDown, onKeyPress, onKeyUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onReset, onSubmit, style, target, title
End tag </form>; never omitted
Contains form_content
Used in block

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.

<form action="http://www.loopandbreak.com/receiveData.php"> 
<!-- The server side file which receives form data -->
...
</form>