Form part 2
The method and name Attributes
The method attribute specifies the HTTP method (GET or POST) to be used when forms are submitted (see below for description):<form action="url" method="GET">
<form action="url" method="POST">
When you use GET, the form data will be visible in the page address.
Use POST if the form is updating data, or includes sensitive information (passwords).
POST offers better security because the submitted data is not visible in the page address.
To take in user input, you need the corresponding form elements, such as text fields. The <input> element has many variations, depending on the type attribute. It can be a text, password, radio, URL, submit, etc.
The example below shows a form requesting a username and password:
Result:
The name attribute specifies a name for a form.
Comments
Post a Comment