HTML FORMS Flashcards

1
Q

What is the natural use of HTML Forms?

A

HTML Forms are mostly used to collect user inputs

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

What tag do you use to create an HTML Form?

A

“form” tags

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

What are some HTML Form attributes?

A

action, autocomplete, method, novalidate, target

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

What does the “action” attribute for an HTML Form do?

A

The “action” attribute defines the action to be performed when the form is submitted.

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

What does the “target” attribute for an HTML Form do?

A

The “target” attribute specifies where to display the response that is received after submitting the form

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

What are the values the “target” attribute for an HTML Form can have and what do they mean?

A

“_blank” - the response will be displayed in a new window or tab
“_self” - the response will be displayed in the current window
“_parent” - the response will be displayed in the parent frame
“_top” - the response will be displayed in the full body of the window
framename - the response will be displayed in a named iframe

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

What does the “method” attribute for an HTML Form do?

A

The “method” attribute specifies the HTTP method to be used when submitting the form data

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

What does the “autocomplete” attribute for an HTML Form do?

A

The autocomplete attribute specifies whether a form should have autocomplete on or off

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

What does the “novalidate” attribute for an HTML Form do?

A

The “novalidate” attribute is a boolean attribute, that when present specifies that the form-data should not be validated when submitted

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

What does the “label” element do?

A

The “label” element defines a label for form elements

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

What attribute should be added to the “label” element to bind it to another form element, and how should it be done?

A

The “for” attribute of the “label” element should be added and should be equal to the “id” attribute of the “input” element to bind them together

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

What element defines a drop-down list?

A

The “select” element

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

For drop-down list, what element is used to create new items in the drop-down list?

A

The “option” element defines an option that can be selected, adding another item to the drop-down list

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

What attribute is added to a drop-down item to make it the pre-selected item?

A

The “selected” attribute

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

How would you create a drop-down list with 4 visible values?

A

“select size=’4’”

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

What does it mean if the drop-down list has the “multiple” attribute added to it?

A

The “multiple” attribute allows the user to select more than one value

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

What does the “textarea” element do?

A

The “textarea” element defines a multi-line input field

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

How would you define the width and height of the “textarea” element without CSS?

A

By using the “rows” and “cols” attribute.
“Rows” specifies the visible number of lines.
“Cols” specifies the visible width.

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

How would you create a button in a form?

A

By using the “button” element

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

What tags do you use to create a group within a form and label that section?

A

Used the “fieldset” element to group related data in a form and label that group with the “legend” element

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

What is the “output” element for in an HTML form?

A

The “output” element represents the results of a calculation

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

What input type defines a single-line text input field?

A

input type=”text”

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

What input type defines a password field?

A

input type=”password”

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

What input type defines a button for submitting form data to a form-handler?

A

input type=”submit”

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

What input type defines a button that will reset all form values to their default values?

A

input type=”reset”

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

What input type defines a set of radio buttons and how do you set it up?

A

input type=”radio”

By creating the radio button and follow that with a label tag to add the text next to the button

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

What input type defines a set of checkboxes?

A

input type=”checkbox”

28
Q

What input type defines a button?

A

input type=”button”

29
Q

What input type is used for input fields that should contain a color?

A

input type=”color”

30
Q

What input type is used for input fields that should contain a date? And what would you use to restrict the date range?

A

input type=”date”

Use min=”” and max=”” to limit/restrict the date range

31
Q

What input type specifies a date and time input field? Does it show the time zone?

A

input type=”datetime-local”

No, it uses the local time zone

32
Q

What input type is used for input fields that should contain an email address?

A

input type=”email”

33
Q

What input type defines a file-select field and a “Browse” button for file uploads?

A

input type=”file”

34
Q

What input type allows a user to select a month and year?

A

input type=”month”

35
Q

What input type defines a numeric input field?

A

input type=”number”

36
Q

What input type defines a control for entering a number whose exact value is not important, such as a slider control?

A

input type=”range”

37
Q

What input type is used for search fields?

A

input type=”search”

38
Q

What input type is used for input fields that should contain a telephone number?

A

input type=”tel”

39
Q

What input type allows the user to select a time?

A

input type=”time”

40
Q

What input type is used for input fields that should contain a URL address?

A

input type=”url”

41
Q

What input type allows the user to select a week and year?

A

input type=”week”

42
Q

What does the input restriction CHECKED mean?

A

Means that an input field should be pre-select when the page loads (for type=”checkbox” and type=”radio”)

43
Q

What does the input restriction DISABLED mean?

A

Means that an input field should be disabled

44
Q

What does the input restriction MAX specify?

A

Specifies the maximum value for an input field

45
Q

What does the input restriction MAXLENGTH specify?

A

Specifies the maximum number of characters for an input field

46
Q

What does the input restriction MIN specify?

A

Specifies the minimum value for an input field

47
Q

What does the input restriction PATTERN specify?

A

Specifies a regular expression to check the input value against

48
Q

What does the input restriction READONLY specify?

A

Specifies that an input field is read only (cannot be changed)

49
Q

What does the input restriction REQUIRED specify?

A

Specifies that an input field is required

50
Q

What does the input restriction SIZE specify?

A

Specifies the width (in characters) of an input field

51
Q

What does the input restriction STEP specify?

A

Specifies the legal number intervals for an input field

52
Q

What does the input restriction VALUE specify?

A

Specifies the default value for an input field

53
Q

What does the input attribute MULTIPLE specify?

A

Specifies that the user is allowed to enter more than one value in the input field

54
Q

What does the input attribute PLACEHOLDER specify?

A

Specifies a short hint that describes the expected value of an input field

55
Q

What does the input attribute AUTOFOCUS specify?

A

Specifies that an input field should automatically get focus when the page loads

56
Q

What does the input attributes HEIGHT and WIDTH specify?

A

Specifies the height and width of an “image” element

57
Q

What does the input attribute LIST refer to?

A

Refers to a “datalist” element that contains pre-defined options for an input element

58
Q

What does the input attribute AUTOCOMPLETE specify?

A

Specifies whether a form or an input field should have autocomplete on or off

59
Q

What does the FORM attribute specify? What is something extra we should note about this attribute?

A

Specifies the form the “input” element belongs to.

NOTE: This is for “input”s that are outside the form they are meant for.

60
Q

What does the FORMACTION attribute specify? What should we note about this attribute? And for what input types does it work for?

A

Specifies the URL of the file that will process the input when the form is submitted.
NOTE: This attribute overrides the action attribute of the “form” element. The attribute works with the “submit” and “image” input types.

61
Q

What does the FORMENCTYPE attribute specify? What should we note about this attribute? And for what input types does it work for?

A

Specifies how the form-data should be encoded when submitted (only for method=”post”).
NOTE: This attribute overrides the enctype attribute of the “form” element. The attribute works with the “submit” and “image” input types.

62
Q

What does the FORMTARGET attribute specify? What should we note about this attribute? And for what input types does it work for?

A

Specifies a name or a keyword that indicates where to display the response that is received after submitting the form.
NOTE: This attribute overrides the target attribute of the “form” element. The attribute works with the “submit” and “image” input types.

63
Q

What does the FORMNOVALIDATE attribute specify? What should we note about this attribute? And for what input types does it work for?

A

Specifies that an “input” element should not be validated when submitted.
NOTE: This attribute overrides the novalidate attribute of the “form” element. The attribute works with the “submit” input type.

64
Q

What does the NOVALIDATE attribute specify?

A

When present, novalidate specifies that all of the form-data should not be validated when submitted.

65
Q

What does the FORMMETHOD attribute define? What should we note about this attribute? And for what input types does it work for?

A

Defines the HTTP method for sending form-data to the action URL.
NOTE: This attribute overrides the method attribute of the “form” element. The attribute works with the “submit” and “image” input types.