Forms in HTML
- Form is the most common way for a user to communicate the information from a web browser to server.
- <form> tag is used to create a HTML form. This tag has several attributes and important among them are "method" and "action".
- action: This attribute specifies the URL of the application, which is to be called when the user clicks the submit button (or) submitting the form.
- method: This attribute specifies how the entered data in form is sent to destination. There are two methods of sending information, one is "post" and other is "get".
Post Method |
Get Method |
Information sent along with body |
Information sent along with URL |
Data is invisible while sending |
Data is visible in site address |
It provides security |
No Security |
It can send any number of characters |
It sends limited characters |
- An HTML form is a section of a document which contains controls such as text fields, password fields, checkboxes, radio buttons, submit button, menus etc.
- An HTML form facilitates the user to enter data that is to be sent to the server for processing.
- HTML forms are required if you want to collect some data from of the site visitor.
User Interface elements in Forms:
Example : "
Lform.html"
login
Output:
Example : "
RegistrationForm.html"
Registration- Form
Output:
Next Topic :Frames in HTML