3.2 Forms Flashcards
(33 cards)
What is the <form> tag used for?
To create an interactive form that collects user input.
What does the action attribute in <form> specify?
The URL where the form data will be sent upon submission.
What are the two main method values for forms?
GET (appends data to URL) & POST (sends data in the HTTP body).
When should you use GET for form submission?
For search forms or when data is not sensitive.
When should you use POST for form submission?
When sending sensitive or large amounts of data (e.g, passwords).
What is <input></input> used for?
A single-line text input field.
What is <input></input> used for?
A text input that obscures characters for password entry.
What is <input></input> used for?
Validates input as a properly formatted email address.
What is <input></input> used for?
Allows users to select a date from a calendar interface.
what is <input></input> used for?
Allows only numeric input, with optional min/max.
What is <input></input> used for?
To allow users to select one or more options from a set.
What is <input></input> used for?
Allows users to select only one option from a group.
What is <input></input> used for?
Submits the form to the URL defined in the action attribute.
What is <input></input> used for ?
Resets all form fields to their initial values.
What is <input></input> used for?
Allows users to upload files from their local system.
What is the <label> tag used for?</label>
Improves accessibility by associating text with form controls.
How do you associate a <label> with an input?</label>
Use the for attribute in <label> to match the input’s id.</label>
What is <textarea> used for?</textarea>
A multi-line text input area, unlike <input></input>.
How do you create a dropdown menu in HTML?
Use <select> with nested <option> elements.</option></select>
How do you make one option pre-selected in a dropdown?
Add the selected attribute to the <option> tag.</option>
What does the <option> tag do?</option>
Defines each individual choice in a dropdown menu.
What is the <fieldset> tag used for?
Groups related form elements into a logical section.
What is the <legend> tag used for?
Provides a caption or title for the content inside a <fieldset>.
What does the placeholder attribute do?
Displays hint text inside an input field until the user types.