form

Support

Creates a container element for controls.

The form element allows users to submit data to a server. The target URL can be specified with the action attribute. The method attribute defines the way of sending.

The contents of the message submitted to the server depend on the named form controls in the form tag. Named control means an element with a non-empty name attribute.

Only the contents or the state of the named form controls will be sent.

The following elements are form controls:

When a form is submitted, the message contains the name/value pairs belonging to the named controls in the form. The name parameter is the value of the name attribute of the control. The contents of the value parameter depend on the type of the control.

Push buttons (button, input:button, input:reset, input:submit) don't play an important part in the message. If a push button is named and it is in pushed state when the form is submitted, then the name and the value (the value of the value attribute) of the button will be sent with the form. If a push button is not in pushed state, no information is sent with the form that belongs to the button. Since only one push button can be in pushed state at any time, they don't play an important part in the message.

The reset button can be used to reset all controls to their initial values within the form. The user can send the form to the server by clicking on the submit button.

The other controls are useful for the message submitted to the server.

Example

<form action="" method="post">
User Name: <input type="text" name="userName" />
<br />
Password: <input type="password" name="password" />
<br />
<input type="reset" value="Reset" />
<input type="submit" value="Sign in" />
</form>

Preview

User Name:
Password: