Lecture 4
Lecture 4
HTML Forms
HTML Forms
• Each form control is given a name, and the text the user types in
or the values of the options they select are sent to the server.
2
HTML Form Structure
• <form>
– This element should always carry the action attribute and will
usually have a method and id attribute too.
• Action
– Every <form> element requires an action attribute. Its value is
the URL for the page on the server that will receive the
information.
• Method
– Forms can be sent using one of two methods: get or
post.
3
HTML FORMS
4
HTML FORMS
6
Grouping Form Elements
The <legend> element can come
You can group related form directly after the opening <fieldset>
controls together inside the tag and contains a caption which
<fieldset> element helps identify the purpose of that
group of form
controls.
7
HTML Form Example