UNIT 4 - Form Elements, Form Attributes, Input Types, Input Form Attributes.
1. Introduction to HTML Forms
HTML forms are used to collect user input and send it to a server for processing. Forms are commonly used for login pages, registration forms, feedback forms and search boxes. Forms make websites interactive.
2. Form Elements
Form elements are the components used inside a form to take input from users. Common form elements include text boxes, radio buttons, checkboxes, submit buttons and dropdown lists.
Important Short Answer Questions
1. What is an HTML form?
An HTML form is used to collect user input and send the data to a server for processing.
2. What are form elements?
Form elements are the HTML controls used inside a form to take input from the user.
Name any four form elements.
- <input>
- <textarea>
- <select>
- <button>
Important Long Answer Question
Explain form elements in HTML.
Form elements are used to collect information from users through a web page.
These elements include input fields, buttons, checkboxes, radio buttons and text areas.
Each form element serves a specific purpose, such as entering text, selecting options or submitting data.
Form elements are placed inside the <form> tag.
They help make websites interactive and allow users to send data to the server.
3. Form Attributes
Form attributes define how form data is sent to the server. Important form attributes include action, method, name and target.
Important Short Answer Questions
1. What are form attributes?
Form attributes are used to control how a form behaves and how the form data is handled when it is submitted.
Name any two form attributes.
- action
- method
2. Which attribute specifies where form data is sent?
The action attribute specifies where the form data is sent.
Important Long Answer Question
Explain form attributes in HTML.
Form attributes are used to control the behavior of an HTML form.
The action attribute specifies the URL where the form data will be sent.
The method attribute defines how data is sent, such as GET or POST.
The name attribute identifies the form and target specifies where the response will be displayed.
Form attributes are essential for proper data handling.
4. Input Types
Input types define the kind of data that can be entered into a form field. Examples include text, password, email, number, radio, checkbox and submit.
Important Short Answer Questions
1. What are input types?
Input types define the kind of data a user can enter in an HTML form field.
2. Name any four input types.
- text
- password
- radio
- checkbox
3. Which input type is used for passwords?
The password input type is used for passwords.
Important Long Answer Question
Explain different input types in HTML.
Input types specify the type of data that users can enter into form fields.
Common input types include text for normal text, password for hidden text, email for email addresses,
number for numeric input, radio for selecting one option and checkbox for selecting multiple options.
Input types help validate data and improve user experience.
5. Input Form Attributes
Input form attributes provide additional information and control over input fields. Common attributes include name, value, placeholder, required and maxlength.
Important Short Answer Questions
1. What are input form attributes?
Input form attributes are used to control the behavior, appearance and validation of input fields in an HTML form.
Name any two input attributes.
- placeholder
- value
2. Which attribute makes an input field mandatory?
The required attribute makes an input field mandatory.
Important Long Answer Question
Explain input form attributes in HTML.
Input form attributes are used to define the behavior and properties of input fields.
The name attribute identifies the input field, while value specifies the default value.
The placeholder attribute displays hint text inside the input box.
The required attribute ensures that the user must fill the field before submitting the form.
These attributes help in data validation and improve usability.
