Chapter 6 Flashcards

1
Q

T/F While JavaScript lets you perform validation in a user’s browser, the server-side programs that receive form data generally perform validation as well

A

True

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

T/F By default, browsers create an collection of form objects that you can reference using array notation

A

True

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

T/F Assistive functions perform a type of validation

A

False

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

T/F You can use HTML to set the default value of a selection list so no option is selected

A

False

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

T/F Modern browsers can perform many validation tasks themselves without any extra JavaScript

A

True

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

To check if an option button is selected, you access the value of its BLANK property

A

checked

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

To display no default value on a selection list, you set its BLANK property to -1

A

selectedIndex

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

Many aspects of the way browsers present browser-based validation feedback are customizable through the properties and methods of the BLANK

A

constraint validation API

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

The BLANK event fires when a form is submitted

A

submit

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

You use the BLANK method on an object to block the action normally associated with an event

A

preventDefault()

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

The BLANK form element is useful for limiting user options to a set of choices

A

selection list

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

You create an empty document fragment using the BLANK method

A

createDocumentFragment()

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

The BLANK attribute enhances usability in modern browsers

A

placeholder

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

What element property would you use when copying the contents of one text field to another text field

A

value

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

Which attribute toggles off validation of a form when added to the opening tag?

A

novalidate

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

Which type value for the input element triggers validation in modern browswers?

A

number

17
Q

In modern browsers, which attribute of an input element prevents the form from being submitted if the field is left blank

A

required

18
Q

Validation errors found by modern browsers are reported in BLANK

A

bubbles

19
Q

In general, modern browsers display validation feedback after the BLANK event is trigged by a form

A

submit

20
Q

You can use the CSS BLANK pseudo-classes to change the properties of form elements based on their validity status

A

:invalid and :valid

21
Q

To check a group of fields and trigger an error message if an of them is empty, you use a(n) BLANK statement

A

loop

22
Q

For any fields that require numeric values, you can use JavaScript’s built-in BLANK function to determine whether a user actually entered a number

A

isNaN()

23
Q

When a control’s value is found to be invalid during constraint validation, the BLANK event is triggered

A

invalid

24
Q

Instead of document.getElementsByTagName(“form”)[0], you could use the code

A

document.forms[0]

25
Q

Use of the BLANK attribute of the form element is not allowed in the strict DTD for XHTML

A

name

26
Q

BLANK is the process of checking that information provided by users conforms to rules to ensure that it appropriately answers a form’s questions and is provided in a format that the site’s back-end programs can work with

A

validation

27
Q

Enhancements to HTML and to modern browsers have allowed browsers themselves to perform many validation tasks without any extra JavaScript. This type of validation is known as BLANK validation

A

browser-based/native/HTML5 validation

28
Q

Creating a function to validate required fields generally involves retrieving the values of the required fields and checking if the value of any of them is BLANK

A

an empty string

29
Q

For all custom validation, it can be helpful to use the BLANK structure for handling errors

A

try/catch

30
Q

To send the values entered in a form to a web server with JavaScript, you use the BLANK method

A

submit()