3.2 Forms Flashcards

(33 cards)

1
Q

What is the <form> tag used for?

A

To create an interactive form that collects user input.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the action attribute in <form> specify?

A

The URL where the form data will be sent upon submission.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the two main method values for forms?

A

GET (appends data to URL) & POST (sends data in the HTTP body).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When should you use GET for form submission?

A

For search forms or when data is not sensitive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When should you use POST for form submission?

A

When sending sensitive or large amounts of data (e.g, passwords).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is <input></input> used for?

A

A single-line text input field.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is <input></input> used for?

A

A text input that obscures characters for password entry.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is <input></input> used for?

A

Validates input as a properly formatted email address.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is <input></input> used for?

A

Allows users to select a date from a calendar interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is <input></input> used for?

A

Allows only numeric input, with optional min/max.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is <input></input> used for?

A

To allow users to select one or more options from a set.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is <input></input> used for?

A

Allows users to select only one option from a group.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is <input></input> used for?

A

Submits the form to the URL defined in the action attribute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is <input></input> used for ?

A

Resets all form fields to their initial values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is <input></input> used for?

A

Allows users to upload files from their local system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the <label> tag used for?</label>

A

Improves accessibility by associating text with form controls.

17
Q

How do you associate a <label> with an input?</label>

A

Use the for attribute in <label> to match the input’s id.</label>

18
Q

What is <textarea> used for?</textarea>

A

A multi-line text input area, unlike <input></input>.

19
Q

How do you create a dropdown menu in HTML?

A

Use <select> with nested <option> elements.</option></select>

20
Q

How do you make one option pre-selected in a dropdown?

A

Add the selected attribute to the <option> tag.</option>

21
Q

What does the <option> tag do?</option>

A

Defines each individual choice in a dropdown menu.

22
Q

What is the <fieldset> tag used for?

A

Groups related form elements into a logical section.

23
Q

What is the <legend> tag used for?

A

Provides a caption or title for the content inside a <fieldset>.

24
Q

What does the placeholder attribute do?

A

Displays hint text inside an input field until the user types.

25
What does the required attributes do?
Makes a form field mandatory before submission.
26
What does the readonly attribute do?
Prevents the user from changing the input value, while still submitting it.
27
What does the disabled attribute do?
Prevents the field from being interacted with or submitted.
28
Can disabled form inputs be sunmitted?
No, disabled fields are ignored during form submission.
29
Can readonly fields be submitted?
Yes, readonly fields are submitted, but not editable.
30
What attribute can you use to provide input validation hints?
Use pattern with a regular expression (e.g, pattern="/d{3}").
31
What attribute can provide contextual help for inputs?
The title attribute shows a tooltip when hovering.
32
How do you group radio buttons?
Use the same name attribute for each .
33
Can forms include non-input elements?
Yes, like
, , or text for organization & labaling.