The <form> tag is used to create an HTML form for user input.
A form can contain input elements like text fields, checkboxes, radio-buttons, submit buttons and more. A forms can also contain select menus, textarea, fieldset, legend, and label elements.
Forms are used to pass data to a server.
Form attributes
1. action value = URL - It Specifies where to send the form-data when a form is submitted
2. accept MIME_type - Specifies the types of files that can be submitted through a file upload(image/gif, pdf, doc etc)
3. enctype
The enctype attribute specifies how form-data should be encoded before sending it to the server.
The form-data is encoded to "application/x-www-form-urlencoded" by default. This means that all characters are encoded before they are sent to the server (spaces are converted to "+" symbols, and special characters are converted to ASCII HEX values).
4. method get/post Specifies how to send form-data
5. name name Specifies the name for a form
6. target _blank/_self/_parent/_top framename Specifies where to open the action URL
No comments:
Post a Comment