Forms Flashcards

1
Q

Which HTML tag is used to create an HTML form for user input?

A

<form>

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

Which attribute specifies whether a form or an input field should allow the browser to predict the value?

A

autocomplete

EXAMPLES: <form action=”action_page.php” autocomplete=”on”>
<input type=”email” autocomplete=”off”>

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

Which attribute specifies that the form input should not be validated when submitted?

A

novalidate

EXAMPLE: <form action=”/action_page.php” novalidate>

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

Which attribute defines the action to be performed when the form is submitted?

A

action

EXAMPLE: <form action=”/action_page.php”>

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

Which attribute specifies how form input should be encoded when submitted to the server?

A

enctype

EXAMPLE: <form action=”/action_page_binary.asp” method=”post” enctype=”multipart/form-data”>

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

Which attribute specifies the HTTP method to be used when submitting the form data?

A

method

EXAMPLE: <form action=”/action_page.php” method=”get” target=”_blank”>

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

Which attribute specifies where to display the response that is received after submitting the form?

A

target

EXAMPLE: <form action=”/action_page.php” method=”get” target=”_blank”>

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

Which attribute refers to pre-defined options contained in a datalist?

A

list

EXAMPLE:<input list=”browsers”>
<datalist id=”browsers”>
</datalist>
Which attribute refers to pre-defined options contained in a datalist?

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

Which attributes define the minimum or maximum value for an <input></input> element?

A

min and max

EXAMPLE: <input type=”number” min=”1” max=”5”>

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

Which attribute defines the maximum length of input allowed in an <input></input> field?

A

maxlength

EXAMPLE: <input type=”text” maxlength=”4”>

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

Which attribute allows the user to enter more than one value in the <input></input> element?

A

multiple

EXAMPLE: <input type=”file” id=”files” multiple>

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

Which attribute checks input into the field against a regular expression, which is a pattern of characters for use in pattern-matching and search-and-replace functions?

A

pattern

EXAMPLE: <input type=”text” pattern=”[A-Za-z]{3}”>

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

Which attribute provides a hint to the user of the input value expected in the <input></input> field?

A

placeholder

EXAMPLE: <input type=”tel” placeholder=”123-45-678”>

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

Which attribute requires input in the field before the form can be submitted?

A

required

EXAMPLE: <input type=”text” required>

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

What do we call the process that tests data input to verify whether the input follows a specified format or meets minimum requirements for character number or type?

A

user input validation

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

Which pattern ensures the user enters a three digit country code?

A

<input type=”text” pattern=”[A-Za-z]{3}”>

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

Which pattern ensures the user enters a date formatted as 1/1/2021?

A

<input type=”text” pattern=”\d{1,2}/\d{1,2}/\d{4}”>

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

Which pattern ensures the user enters a valid email address?

A

<input type=”email” pattern=”^.+@.+$”>

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

Which pattern ensures the user enters latitude/longitude?

A

<input type=”text” pattern=”-?\d{1,3}.\d+”>

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

Which pattern ensures the user enters a price?

A

<input type=”text” pattern=”\d+(.\d{2})?”>

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

Which pattern ensures the user enters a URL beginning with https?

A

<input type=”url” pattern=”https?://.+”>

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

Which input type displays as round buttons in a group of mutually exclusive pre-determined choices?

A

<input type=”radio”>

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

Which HTML element submits a user’s completed form data to the server for processing?

A

<button type=”submit”>

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

Which HTML element resets the form data to its initial value?

A

<button type=”reset”>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Which HTML element creates a clickable button that does not directly affect form data and allows text and images to be placed within its tags?
\
26
Which input type displays as square buttons in a group of pre-determined choices from which the user can select more than one choice?
\
27
Which element creates a rectangular field that can expand upon user interaction and allow users to select one or more pre-determined choices?
\
30
Which input type allows the user to choose colors?
\
31
Which input type allows the user to enter a date (without time zone) using a drop-down date-picker calendar?
\
32
Which input type allows the user to choose a date and time with a GMT time zone?
\
33
Which input type allows the user to choose a date and time with a local time zone?
\
34
Which input type allows the user to enter an e-mail address?
\
35
Which input type allows the user to choose a date using the month and year (without time zone)?
\
36
Which input type allows the user to enter rational integers or float values?
\
37
Which input type allows the user to enter numbers using a slider control?
\
38
Which input type allows the user to enter text for a search query?
\
39
Which input type allows the user to enter a phone number?
\
40
Which input type allows the user to enter a time (without time zone)?
\
41
Which input type allows the user to enter a URL, such as an http://, ftp:// or mailto: address?
\
42
Which input type allows the user to choose a date using the week and year (without time zone)?
\
43
Which element specifies a list of pre-defined choices for an element?
\
44
Which element adds security to a form through asymmetric encryption by creating a key-pair generator field in the form?
\
45
Which element displays the result when a calculation is performed?
\
46
Which attribute applies focus on the element when the page loads?
autofocus EXAMPLE: \
47
Which attribute disables an element?
disabled EXAMPLE: \
48
Which attribute specifies the IDs of elements whose values were used?
for EXAMPLE: \
49
Which attribute specifies the form(s) on the page in which the element appears?
form EXAMPLE: \
50
Which attribute specifies a name for the element that can be used to reference it?
name EXAMPLE: \
51
Which attribute specifies whether text submitted in a form field is to be wrapped?
wrap EXAMPLE: \
52
Which element allows you to add a caption for a group of items created by the
element?
\
53
Which element is used to group elements so that related fields are placed together in a form?
\
54
Which element enables you to add a label to an input element in a form?
\
55
When you use the element to create form fields, what occurs if you neglect to include the type attribute?
The browser will use the default type of text.
56
What occurs if an input type is not supported by a browser (example: search)?
The browser will degrade to a standard text box.
57
What is a disadvantage of waiting to validate user input until after the user completes the form?
Some users may become frustrated if they need to submit and resubmit a form until it validates.
58
What is the benefit of inline validation?
Users can resolve errors as they fill out each form field and submit the completed form just once.
59
What can validation techniques not check for?
truthful information
60
This JavaScript code is the equivalent of which HTML5 attribute? function validateForm(){ var x = document.forms["myForm"]["number"].value; if (!x){alert("Please enter a phone number"); return false;} }
The 'required' attribute
61
This JavaScript code is the equivalent of which HTML5 attribute? function validateForm(){ var x = document.forms["myForm"]["email"].value; var atpos=x.indexOf("@"); var dotpos=x.lastIndexOf("."); if (atpos < 1 || dotpos < atpos+2 || dotpos + 2 >= x.length){ alert("Please enter a valid e-mail address"); return false;} }
The 'pattern' attribute
62
Calculations in a Web page form are usually performed by what?
a script
63
Do HTML5 input types display differently or the same in various browsers?
differently
64
What is the default security algorithm used with the HTML5 element?
RSA
65
What two keys are created by the HTML5 element?
A private key and a public key
66
Prior to HTML5, what did Web developers use to conduct inline validation in HTML forms?
JavaScript