Deck 13: Programming for Web Forms Tutorial

Full screen (f)
exit full mode
Question
Word boundaries are indicated by the \b symbol.
Use Space or
up arrow
down arrow
to flip the card.
Question
The input.defaultValue method returns whether the input box is read-only or not.
Question
The Luhn Algorithm provides a quick validation check on an account number by ensuring that the sum of the digits in the number meet certain mathematical criteria
Question
To determine which option button has been checked by the user, you must examine the disabled property of each button.
Question
The element.valid property of Constraint Validation API returns true if element fails validation.
Question
The select.name method returns the selection list field name.
Question
Each field/value pair is separated by the * character.
Question
The \D character signifies a digit from 0 to 9.
Question
The option.text method returns the field value of option .
Question
The regular expression for 4-digit CVC numbers used by American Express card holders is /^\d{4}$/ .
Question
The charAt() method can extract long text strings.
Question
For options buttons and check boxes, you can use the onclick event handler in response to the user clicking those elements.
Question
With no arguments, the toLocaleString() method displays the numeric value using the local standards on the user's computer.
Question
The element.onselect event handler signifies that the element value is invalid.
Question
To make a regular expression insensitive to case, add the i flag to the regular expression.
Question
You can control the number of digits displayed by the browser using the toFixed() method.
Question
You can load a new page in the current window with the window.location = url command.
Question
To extract useful information from the query string, you must first work with the properties and methods of the location object.
Question
The value associated with a checked box is stored in the name property of the check box object.
Question
The element.value = value; expression is applied to set the value of an input control.
Question
Identify the reason for which attribute is added to a form element.

A) To find the pathname of the URL
B) retrieve specific information about the URL
C) To append form data to the URL
D) To load a new document with the URL
Question
Which of the following selection list properties returns true if more than one option can be selected from the list?

A) select.options
B) select.length
C) select.size
D) select.multiple
Question
Which of the following location methods returns the href portion of the location's URL?

A) location.assign(newurl)
B) location.hash
C) location.toString()
D) location.searchname
Question
Identify the description of the option.selected property.

A) It returns true if the option has been selected by default.
B) It returns true if the option has been selected by user.
C) It returns true if more than one option can be selected from the list.
D) It returns true if no option can be selected from the list.
Question
Which of the following expressions can be used to reference a form element using its name or id attribute?

A) form.elements.ename;
B) ename.form.elements;
C) elements.form.ename;
D) ename.elements.form;
Question
The _____ property returns a Boolean value indicating whether the option button, option , is currently checked by a user.

A) option.value
B) option.checked
C) option.defaultChecked
D) option.name
Question
Identify the input field property or method that can be used to return the current value displayed in the input box.

A) input.focus()
B) input.defaultValue
C) input.blur()
D) input.value
Question
Identify the options object collection in which the selection list options are organized.

A) select.options
B) options.length
C) select.options[idref]
D) idref.options[select]
Question
Using the _____, you can direct the browser to retrieve specific information about the URL, to reload the current page, or to load an entirely new page.

A) selection list
B) hidden field
C) reference form
D) location object
Question
Which of the following CSS selector returns the option button that is checked within the protection field?

A) input[name="protection"]:checked
B) name[input="protection"]:checked
C) name[input="checked"]:protection
D) input[name="checked"]:protection
Question
Radio buttons are grouped by a common field name placed within the _____ array.

A) options[idref]
B) length[idref]
C) select.options[idref]
D) select.length[idref]
Question
Which of the following descriptions corresponds to the currency:code option from the toLocaleString() method?

A) Currency symbol to use for currency formatting where code designates the country or language
B) Currency symbol to use for currency formatting where code is the ISO currency code
C) Currency symbol to use for indicating whether to use a thousands grouping symbol (true) or not (false)
D) Currency symbol to use for currency formatting where code is "symbol" for a currency symbol
Question
Since a page can contain multiple web forms, JavaScript organizes the forms into _____ object collection.

A) document.idref[forms]
B) idref.document[forms]
C) document.forms[idref]
D) forms.document[idref]
Question
_____ is a selection list property that returns the number of options displayed in the selection list.

A) select.options
B) select.length
C) select.size
D) select.multiple
Question
The _____ option from the toLocaleString() method indicates whether to use a thousands grouping symbol (true) or not (false) .

A) style: type
B) minimumSignficantDigits: num
C) useGroup: Boolean
D) maximumSignificantDigits: num
Question
Identify the toLocaleString() method that gives you more control while formatting numeric values.

A) locale.toLocaleString(value, {options})
B) value.toLocaleString(locale, {options})
C) options.toLocaleString(locale, {value})
D) value.toLocaleString(options, {locale})
Question
For options buttons and check boxes, use the _____ event handler in response to the user clicking those elements.

A) onselect
B) onreset
C) onclick
D) oninput
Question
Identify the method associated with browser locations that can find the protocol, hostname, and port number of the URL.

A) location.pathname
B) location.hash
C) location.origin
D) location.search
Question
Identify the input field property or method that can be used to remove the focus from the input box.

A) input.focus()
B) input.pattern
C) input.blur()
D) input.required
Question
In many web forms, important data is stored within _____ so that the data is available to programmers but removed from the user's control.

A) event handlers
B) hidden fields
C) reference forms
D) radio buttons
Question
To create a negative character class that matches any character not in the class, preface the list of characters with the _____ symbol.

A) ^
B) #
C) &
D) *
Question
What does & signify in the string "R2D2&C3PO"?

A) A new line between words
B) A white space between words
C) A character between words
D) A boundary between words
Question
In a regular expression, you can define two possible patterns for the same text string by joining different patterns using the _____ character. 13

A) &
B) *
C) +
D) |
Question
Identify the description for the \b character type.

A) Not a word boundary
B) A blank space
C) A word boundary
D) Any character
Question
Identify the use of string.indexOf(str [,start]) method.

A) To create an array of substrings
B) To extract text strings known as substrings
C) To reference a character
D) To search for the occurrence of a substring within larger text strings
Question
Which of the following character types is used for any non-white-space character?

A) \s
B) \S
C) \w
D) \W
Question
Which of the following objects is used by JavaScript to store the reason for failing validation?

A) ValidityState
B) checkValidity
C) willValidate
D) noValidate
Question
Which of the following should be appended to a character to repeat it n times?

A) [ n ]
B) " n "
C) { n }
D) ( n )
Question
When the browser encounters a character in a field name or value that is reserved for other purposes, it replaces the character with a character code known as the _____.

A) URL query string
B) form field
C) radio button
D) URI encoded character
Question
In addition to a specified pattern of characters, all legitimate credit card numbers must satisfy the Luhn Algorithm also known as the _____.

A) Euclid's Algorithm
B) Mod10 Algorithm
C) Verhoeff Algorithm
D) Damm Algorithm
Question
The regular expression pattern for a character class is _____.

A) *chars*
B) [chars]
C) (chars)
D) /chars/
Question
Which of the following methods can be used to extract longer text strings?

A) slice.string(start [,end])
B) string.start(slice [,end])
C) string.slice(start [,end])
D) slice.start(string [,end])
Question
Identify the action for which the g flag is added at the end of the regular expression /pattern/ .

A) To perform a global search
B) To create an array of substrings
C) To make a regular expression insensitive to case
D) To retrieve field values from selection lists and radio buttons
Question
Identify the object constructor that can be used to create a text string explicitly.

A) var stringVar = new String(text
B) new string stringVar = var(text
C) stringVar = new String(var);
D) var stringVar = new Stringvar(var);
Question
Regular expressions have the general form denoted as _____.

A) *pattern*
B) [pattern]
C) /pattern/
D) //pattern//
Question
The code of a regular expression can be directly entered in JavaScript as a _____.

A) regular expression pattern
B) regular expression literal
C) regular expression match
D) regular expression symbol
Question
Identify the method that can be used to create an array of substrings.

A) strArray = split.string (str)
B) strArray = string.split(str)
C) strArray = str.split(string)
D) strArray = (str)string.split
Question
Which of the following methods can be used to reference a character at the index i of the string?

A) string.charAt(I)
B) string(i).charAt
C) charAt.string(i)
D) charAt(i).string
Question
Identify the collective term that denotes the form validation properties and methods built into JavaScript that can be used to supplement the native browser validation tools.

A) pop-up error messages
B) Custom validation messages
C) Constraint Validation API
D) Remote Method Invocation API
Question
Identify the syntax used to group character symbols so they can be treated as a single unit.

A) {pattern}
B) (pattern)
C) [pattern]
D) "pattern"
Question
Case based critical thinking Case 13-1 Sarah wants to set the value of an input control. She applies the element.value = value; expression. Which of the following methods should Sarah use to return the default value for the input box?

A) input.value
B) input.focus()
C) input.defaultValue
D) input.select()
Question
Match between columns
The element contains data whose character length exceeds the value of the length attribute.
element.validity.typeMismatch
The element contains data whose character length exceeds the value of the length attribute.
element.validity.tooLong
The element contains data whose character length exceeds the value of the length attribute.
element.validity.valid
The element contains data whose character length exceeds the value of the length attribute.
element.validity.patternMismatch
The element contains data whose character length exceeds the value of the length attribute.
element.validity.customError
The element contains data whose character length exceeds the value of the length attribute.
element.validity.badInput
The field element, element , contains data that the browser is unable to convert.
element.validity.typeMismatch
The field element, element , contains data that the browser is unable to convert.
element.validity.tooLong
The field element, element , contains data that the browser is unable to convert.
element.validity.valid
The field element, element , contains data that the browser is unable to convert.
element.validity.patternMismatch
The field element, element , contains data that the browser is unable to convert.
element.validity.customError
The field element, element , contains data that the browser is unable to convert.
element.validity.badInput
The element contains data that does not match the data type specified by the type attribute.
element.validity.typeMismatch
The element contains data that does not match the data type specified by the type attribute.
element.validity.tooLong
The element contains data that does not match the data type specified by the type attribute.
element.validity.valid
The element contains data that does not match the data type specified by the type attribute.
element.validity.patternMismatch
The element contains data that does not match the data type specified by the type attribute.
element.validity.customError
The element contains data that does not match the data type specified by the type attribute.
element.validity.badInput
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.typeMismatch
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.tooLong
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.valid
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.patternMismatch
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.customError
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.badInput
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.typeMismatch
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.tooLong
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.valid
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.patternMismatch
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.customError
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.badInput
The element contains valid data, satisfying all constraints.
element.validity.typeMismatch
The element contains valid data, satisfying all constraints.
element.validity.tooLong
The element contains valid data, satisfying all constraints.
element.validity.valid
The element contains valid data, satisfying all constraints.
element.validity.patternMismatch
The element contains valid data, satisfying all constraints.
element.validity.customError
The element contains valid data, satisfying all constraints.
element.validity.badInput
Question
Case based critical thinking Case 13-5 William is exploring the syntax of regular expressions. He learns that in the regular expression language, a word refers to any string of symbols consisting solely of word characters. He also learns that word boundaries are indicated by the \b symbol. He wants to use a pattern that matches any word that starts with the characters "great" such as "greater", "greatness", or "greatest" Which of the following patterns should William use?

A) //bgreat/
B) /\bgreat/
C) /bgreat/
D) /b\great/
Question
Match between columns
Allows the browser to automatically complete form fields
form.autocomplete
Allows the browser to automatically complete form fields
form.length
Allows the browser to automatically complete form fields
form.requestAutocomplete()
Allows the browser to automatically complete form fields
form.reset()
Allows the browser to automatically complete form fields
form.submit()
Returns the number of elements in the form
form.autocomplete
Returns the number of elements in the form
form.length
Returns the number of elements in the form
form.requestAutocomplete()
Returns the number of elements in the form
form.reset()
Returns the number of elements in the form
form.submit()
Submits the web form
form.autocomplete
Submits the web form
form.length
Submits the web form
form.requestAutocomplete()
Submits the web form
form.reset()
Submits the web form
form.submit()
Resets the web form
form.autocomplete
Resets the web form
form.length
Resets the web form
form.requestAutocomplete()
Resets the web form
form.reset()
Resets the web form
form.submit()
Initiates autocompletion of those form fields that have autocomplete activated
form.autocomplete
Initiates autocompletion of those form fields that have autocomplete activated
form.length
Initiates autocompletion of those form fields that have autocomplete activated
form.requestAutocomplete()
Initiates autocompletion of those form fields that have autocomplete activated
form.reset()
Initiates autocompletion of those form fields that have autocomplete activated
form.submit()
Question
Case based critical thinking Case 13-4 Samantha is working on a web document. She wants to direct the browser to retrieve specific information about a URL, to reload the current page, and to load an entirely new page. Which of the following commands can Samantha use to load a new page in the current window?

A) window.location = url
B) url.window = location
C) window.url = location
D) location.url = window
Question
Case based critical thinking Case 13-3 Thomas is working on reference forms and form fields. He wants to use event handlers that can respond to user actions within a form. He uses the element.onchange event handler. Identify the description of the event handler Thomas has used.

A) The element has received user input
B) The value of element has been modified
C) The element value is invalid
D) The form element has lost the focus
Question
Match between columns
The element contains data whose character length exceeds the value of the length attribute.
element.validity.typeMismatch
The element contains data whose character length exceeds the value of the length attribute.
element.validity.tooLong
The element contains data whose character length exceeds the value of the length attribute.
element.validity.valid
The element contains data whose character length exceeds the value of the length attribute.
element.validity.patternMismatch
The element contains data whose character length exceeds the value of the length attribute.
element.validity.customError
The element contains data whose character length exceeds the value of the length attribute.
element.validity.badInput
The element contains valid data, satisfying all constraints.
element.validity.typeMismatch
The element contains valid data, satisfying all constraints.
element.validity.tooLong
The element contains valid data, satisfying all constraints.
element.validity.valid
The element contains valid data, satisfying all constraints.
element.validity.patternMismatch
The element contains valid data, satisfying all constraints.
element.validity.customError
The element contains valid data, satisfying all constraints.
element.validity.badInput
The field element, element , contains data that the browser is unable to convert.
element.validity.typeMismatch
The field element, element , contains data that the browser is unable to convert.
element.validity.tooLong
The field element, element , contains data that the browser is unable to convert.
element.validity.valid
The field element, element , contains data that the browser is unable to convert.
element.validity.patternMismatch
The field element, element , contains data that the browser is unable to convert.
element.validity.customError
The field element, element , contains data that the browser is unable to convert.
element.validity.badInput
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.typeMismatch
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.tooLong
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.valid
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.patternMismatch
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.customError
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.badInput
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.typeMismatch
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.tooLong
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.valid
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.patternMismatch
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.customError
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.badInput
The element contains data that does not match the data type specified by the type attribute.
element.validity.typeMismatch
The element contains data that does not match the data type specified by the type attribute.
element.validity.tooLong
The element contains data that does not match the data type specified by the type attribute.
element.validity.valid
The element contains data that does not match the data type specified by the type attribute.
element.validity.patternMismatch
The element contains data that does not match the data type specified by the type attribute.
element.validity.customError
The element contains data that does not match the data type specified by the type attribute.
element.validity.badInput
Question
Case based critical thinking Case 13-4 Samantha is working on a web document. She wants to direct the browser to retrieve specific information about a URL, to reload the current page, and to load an entirely new page. Identify the object that Samantha should use to meet her desired requirements.

A) location
B) option
C) form
D) string
Question
Case based critical thinking Case 13-2 Lisa can control the number of digits displayed by the browser using the toFixed() method. However, since the toFixed() method is limited to only defining the decimal place accuracy, she wants to use a method that gives her more control over the numeric format, such as formatting numbers as currency or separating thousands with the comma symbol. Which of the following methods should Lisa use to format the numbers as currency?

A) currency: code
B) toLocaleString()
C) useGroup: Boolean
D) element.oninput
Question
Case based critical thinking Case 13-3 Thomas is working on reference forms and form fields. He wants to use event handlers that can respond to user actions within a form. He uses the element.onchange event handler. Which event handler should Thomas use for options buttons and check boxes in response to the user clicking those elements?

A) element.onfocus
B) element.onreset
C) element.onblur
D) element.onclick
Question
Match between columns
Resets the web form
form.autocomplete
Resets the web form
form.length
Resets the web form
form.requestAutocomplete()
Resets the web form
form.reset()
Resets the web form
form.submit()
Initiates autocompletion of those form fields that have autocomplete activated
form.autocomplete
Initiates autocompletion of those form fields that have autocomplete activated
form.length
Initiates autocompletion of those form fields that have autocomplete activated
form.requestAutocomplete()
Initiates autocompletion of those form fields that have autocomplete activated
form.reset()
Initiates autocompletion of those form fields that have autocomplete activated
form.submit()
Submits the web form
form.autocomplete
Submits the web form
form.length
Submits the web form
form.requestAutocomplete()
Submits the web form
form.reset()
Submits the web form
form.submit()
Returns the number of elements in the form
form.autocomplete
Returns the number of elements in the form
form.length
Returns the number of elements in the form
form.requestAutocomplete()
Returns the number of elements in the form
form.reset()
Returns the number of elements in the form
form.submit()
Allows the browser to automatically complete form fields
form.autocomplete
Allows the browser to automatically complete form fields
form.length
Allows the browser to automatically complete form fields
form.requestAutocomplete()
Allows the browser to automatically complete form fields
form.reset()
Allows the browser to automatically complete form fields
form.submit()
Question
Match between columns
Premises:
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
Submits the web form
Submits the web form
Submits the web form
Submits the web form
Submits the web form
Submits the web form
Submits the web form
Submits the web form
Submits the web form
Submits the web form
Submits the web form
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
Resets the web form
Resets the web form
Resets the web form
Resets the web form
Resets the web form
Resets the web form
Resets the web form
Resets the web form
Resets the web form
Resets the web form
Resets the web form
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
Responses:
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
Question
Explain how the Luhn Algorithm can be used to test for legitimate card numbers.
Question
Explain how you can work with radio buttons and check boxes.
Question
Explain how you can work with selection lists.
Question
Case based critical thinking Case 13-1 Sarah wants to set the value of an input control. She applies the element.value = value; expression. What does element signify in the expression that Sarah has used?

A) Reference to a form element
B) Index number of the form
C) Value to be stored in the element
D) Reference to a web form
Question
Case based critical thinking Case 13-5 William is exploring the syntax of regular expressions. He learns that in the regular expression language, a word refers to any string of symbols consisting solely of word characters. He also learns that word boundaries are indicated by the \b symbol. He wants to use a pattern that matches any word that starts with the characters "great" such as "greater", "greatness", or "greatest" Which of the following patterns should William use to match any word that ends with "ust" such as "dust", "trust", or "must"?

A) /ust\b/
B) /\bust/
C) \bust/
D) /b\ust/
Question
Case based critical thinking Case 13-2 Lisa can control the number of digits displayed by the browser using the toFixed() method. However, since the toFixed() method is limited to only defining the decimal place accuracy, she wants to use a method that gives her more control over the numeric format, such as formatting numbers as currency or separating thousands with the comma symbol. If Lisa uses minimumIntegerDigits: num method, which of the following is the correct range for num ?

A) 0 to 20
B) 1 to 20
C) 0 to 19
D) 1 to 21
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/78
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 13: Programming for Web Forms Tutorial
1
Word boundaries are indicated by the \b symbol.
True
2
The input.defaultValue method returns whether the input box is read-only or not.
False
3
The Luhn Algorithm provides a quick validation check on an account number by ensuring that the sum of the digits in the number meet certain mathematical criteria
True
4
To determine which option button has been checked by the user, you must examine the disabled property of each button.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
5
The element.valid property of Constraint Validation API returns true if element fails validation.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
6
The select.name method returns the selection list field name.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
7
Each field/value pair is separated by the * character.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
8
The \D character signifies a digit from 0 to 9.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
9
The option.text method returns the field value of option .
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
10
The regular expression for 4-digit CVC numbers used by American Express card holders is /^\d{4}$/ .
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
11
The charAt() method can extract long text strings.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
12
For options buttons and check boxes, you can use the onclick event handler in response to the user clicking those elements.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
13
With no arguments, the toLocaleString() method displays the numeric value using the local standards on the user's computer.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
14
The element.onselect event handler signifies that the element value is invalid.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
15
To make a regular expression insensitive to case, add the i flag to the regular expression.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
16
You can control the number of digits displayed by the browser using the toFixed() method.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
17
You can load a new page in the current window with the window.location = url command.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
18
To extract useful information from the query string, you must first work with the properties and methods of the location object.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
19
The value associated with a checked box is stored in the name property of the check box object.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
20
The element.value = value; expression is applied to set the value of an input control.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
21
Identify the reason for which attribute is added to a form element.

A) To find the pathname of the URL
B) retrieve specific information about the URL
C) To append form data to the URL
D) To load a new document with the URL
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
22
Which of the following selection list properties returns true if more than one option can be selected from the list?

A) select.options
B) select.length
C) select.size
D) select.multiple
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
23
Which of the following location methods returns the href portion of the location's URL?

A) location.assign(newurl)
B) location.hash
C) location.toString()
D) location.searchname
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
24
Identify the description of the option.selected property.

A) It returns true if the option has been selected by default.
B) It returns true if the option has been selected by user.
C) It returns true if more than one option can be selected from the list.
D) It returns true if no option can be selected from the list.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
25
Which of the following expressions can be used to reference a form element using its name or id attribute?

A) form.elements.ename;
B) ename.form.elements;
C) elements.form.ename;
D) ename.elements.form;
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
26
The _____ property returns a Boolean value indicating whether the option button, option , is currently checked by a user.

A) option.value
B) option.checked
C) option.defaultChecked
D) option.name
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
27
Identify the input field property or method that can be used to return the current value displayed in the input box.

A) input.focus()
B) input.defaultValue
C) input.blur()
D) input.value
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
28
Identify the options object collection in which the selection list options are organized.

A) select.options
B) options.length
C) select.options[idref]
D) idref.options[select]
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
29
Using the _____, you can direct the browser to retrieve specific information about the URL, to reload the current page, or to load an entirely new page.

A) selection list
B) hidden field
C) reference form
D) location object
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
30
Which of the following CSS selector returns the option button that is checked within the protection field?

A) input[name="protection"]:checked
B) name[input="protection"]:checked
C) name[input="checked"]:protection
D) input[name="checked"]:protection
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
31
Radio buttons are grouped by a common field name placed within the _____ array.

A) options[idref]
B) length[idref]
C) select.options[idref]
D) select.length[idref]
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
32
Which of the following descriptions corresponds to the currency:code option from the toLocaleString() method?

A) Currency symbol to use for currency formatting where code designates the country or language
B) Currency symbol to use for currency formatting where code is the ISO currency code
C) Currency symbol to use for indicating whether to use a thousands grouping symbol (true) or not (false)
D) Currency symbol to use for currency formatting where code is "symbol" for a currency symbol
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
33
Since a page can contain multiple web forms, JavaScript organizes the forms into _____ object collection.

A) document.idref[forms]
B) idref.document[forms]
C) document.forms[idref]
D) forms.document[idref]
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
34
_____ is a selection list property that returns the number of options displayed in the selection list.

A) select.options
B) select.length
C) select.size
D) select.multiple
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
35
The _____ option from the toLocaleString() method indicates whether to use a thousands grouping symbol (true) or not (false) .

A) style: type
B) minimumSignficantDigits: num
C) useGroup: Boolean
D) maximumSignificantDigits: num
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
36
Identify the toLocaleString() method that gives you more control while formatting numeric values.

A) locale.toLocaleString(value, {options})
B) value.toLocaleString(locale, {options})
C) options.toLocaleString(locale, {value})
D) value.toLocaleString(options, {locale})
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
37
For options buttons and check boxes, use the _____ event handler in response to the user clicking those elements.

A) onselect
B) onreset
C) onclick
D) oninput
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
38
Identify the method associated with browser locations that can find the protocol, hostname, and port number of the URL.

A) location.pathname
B) location.hash
C) location.origin
D) location.search
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
39
Identify the input field property or method that can be used to remove the focus from the input box.

A) input.focus()
B) input.pattern
C) input.blur()
D) input.required
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
40
In many web forms, important data is stored within _____ so that the data is available to programmers but removed from the user's control.

A) event handlers
B) hidden fields
C) reference forms
D) radio buttons
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
41
To create a negative character class that matches any character not in the class, preface the list of characters with the _____ symbol.

A) ^
B) #
C) &
D) *
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
42
What does & signify in the string "R2D2&C3PO"?

A) A new line between words
B) A white space between words
C) A character between words
D) A boundary between words
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
43
In a regular expression, you can define two possible patterns for the same text string by joining different patterns using the _____ character. 13

A) &
B) *
C) +
D) |
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
44
Identify the description for the \b character type.

A) Not a word boundary
B) A blank space
C) A word boundary
D) Any character
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
45
Identify the use of string.indexOf(str [,start]) method.

A) To create an array of substrings
B) To extract text strings known as substrings
C) To reference a character
D) To search for the occurrence of a substring within larger text strings
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
46
Which of the following character types is used for any non-white-space character?

A) \s
B) \S
C) \w
D) \W
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
47
Which of the following objects is used by JavaScript to store the reason for failing validation?

A) ValidityState
B) checkValidity
C) willValidate
D) noValidate
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
48
Which of the following should be appended to a character to repeat it n times?

A) [ n ]
B) " n "
C) { n }
D) ( n )
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
49
When the browser encounters a character in a field name or value that is reserved for other purposes, it replaces the character with a character code known as the _____.

A) URL query string
B) form field
C) radio button
D) URI encoded character
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
50
In addition to a specified pattern of characters, all legitimate credit card numbers must satisfy the Luhn Algorithm also known as the _____.

A) Euclid's Algorithm
B) Mod10 Algorithm
C) Verhoeff Algorithm
D) Damm Algorithm
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
51
The regular expression pattern for a character class is _____.

A) *chars*
B) [chars]
C) (chars)
D) /chars/
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
52
Which of the following methods can be used to extract longer text strings?

A) slice.string(start [,end])
B) string.start(slice [,end])
C) string.slice(start [,end])
D) slice.start(string [,end])
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
53
Identify the action for which the g flag is added at the end of the regular expression /pattern/ .

A) To perform a global search
B) To create an array of substrings
C) To make a regular expression insensitive to case
D) To retrieve field values from selection lists and radio buttons
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
54
Identify the object constructor that can be used to create a text string explicitly.

A) var stringVar = new String(text
B) new string stringVar = var(text
C) stringVar = new String(var);
D) var stringVar = new Stringvar(var);
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
55
Regular expressions have the general form denoted as _____.

A) *pattern*
B) [pattern]
C) /pattern/
D) //pattern//
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
56
The code of a regular expression can be directly entered in JavaScript as a _____.

A) regular expression pattern
B) regular expression literal
C) regular expression match
D) regular expression symbol
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
57
Identify the method that can be used to create an array of substrings.

A) strArray = split.string (str)
B) strArray = string.split(str)
C) strArray = str.split(string)
D) strArray = (str)string.split
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
58
Which of the following methods can be used to reference a character at the index i of the string?

A) string.charAt(I)
B) string(i).charAt
C) charAt.string(i)
D) charAt(i).string
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
59
Identify the collective term that denotes the form validation properties and methods built into JavaScript that can be used to supplement the native browser validation tools.

A) pop-up error messages
B) Custom validation messages
C) Constraint Validation API
D) Remote Method Invocation API
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
60
Identify the syntax used to group character symbols so they can be treated as a single unit.

A) {pattern}
B) (pattern)
C) [pattern]
D) "pattern"
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
61
Case based critical thinking Case 13-1 Sarah wants to set the value of an input control. She applies the element.value = value; expression. Which of the following methods should Sarah use to return the default value for the input box?

A) input.value
B) input.focus()
C) input.defaultValue
D) input.select()
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
62
Match between columns
The element contains data whose character length exceeds the value of the length attribute.
element.validity.typeMismatch
The element contains data whose character length exceeds the value of the length attribute.
element.validity.tooLong
The element contains data whose character length exceeds the value of the length attribute.
element.validity.valid
The element contains data whose character length exceeds the value of the length attribute.
element.validity.patternMismatch
The element contains data whose character length exceeds the value of the length attribute.
element.validity.customError
The element contains data whose character length exceeds the value of the length attribute.
element.validity.badInput
The field element, element , contains data that the browser is unable to convert.
element.validity.typeMismatch
The field element, element , contains data that the browser is unable to convert.
element.validity.tooLong
The field element, element , contains data that the browser is unable to convert.
element.validity.valid
The field element, element , contains data that the browser is unable to convert.
element.validity.patternMismatch
The field element, element , contains data that the browser is unable to convert.
element.validity.customError
The field element, element , contains data that the browser is unable to convert.
element.validity.badInput
The element contains data that does not match the data type specified by the type attribute.
element.validity.typeMismatch
The element contains data that does not match the data type specified by the type attribute.
element.validity.tooLong
The element contains data that does not match the data type specified by the type attribute.
element.validity.valid
The element contains data that does not match the data type specified by the type attribute.
element.validity.patternMismatch
The element contains data that does not match the data type specified by the type attribute.
element.validity.customError
The element contains data that does not match the data type specified by the type attribute.
element.validity.badInput
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.typeMismatch
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.tooLong
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.valid
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.patternMismatch
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.customError
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.badInput
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.typeMismatch
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.tooLong
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.valid
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.patternMismatch
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.customError
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.badInput
The element contains valid data, satisfying all constraints.
element.validity.typeMismatch
The element contains valid data, satisfying all constraints.
element.validity.tooLong
The element contains valid data, satisfying all constraints.
element.validity.valid
The element contains valid data, satisfying all constraints.
element.validity.patternMismatch
The element contains valid data, satisfying all constraints.
element.validity.customError
The element contains valid data, satisfying all constraints.
element.validity.badInput
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
63
Case based critical thinking Case 13-5 William is exploring the syntax of regular expressions. He learns that in the regular expression language, a word refers to any string of symbols consisting solely of word characters. He also learns that word boundaries are indicated by the \b symbol. He wants to use a pattern that matches any word that starts with the characters "great" such as "greater", "greatness", or "greatest" Which of the following patterns should William use?

A) //bgreat/
B) /\bgreat/
C) /bgreat/
D) /b\great/
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
64
Match between columns
Allows the browser to automatically complete form fields
form.autocomplete
Allows the browser to automatically complete form fields
form.length
Allows the browser to automatically complete form fields
form.requestAutocomplete()
Allows the browser to automatically complete form fields
form.reset()
Allows the browser to automatically complete form fields
form.submit()
Returns the number of elements in the form
form.autocomplete
Returns the number of elements in the form
form.length
Returns the number of elements in the form
form.requestAutocomplete()
Returns the number of elements in the form
form.reset()
Returns the number of elements in the form
form.submit()
Submits the web form
form.autocomplete
Submits the web form
form.length
Submits the web form
form.requestAutocomplete()
Submits the web form
form.reset()
Submits the web form
form.submit()
Resets the web form
form.autocomplete
Resets the web form
form.length
Resets the web form
form.requestAutocomplete()
Resets the web form
form.reset()
Resets the web form
form.submit()
Initiates autocompletion of those form fields that have autocomplete activated
form.autocomplete
Initiates autocompletion of those form fields that have autocomplete activated
form.length
Initiates autocompletion of those form fields that have autocomplete activated
form.requestAutocomplete()
Initiates autocompletion of those form fields that have autocomplete activated
form.reset()
Initiates autocompletion of those form fields that have autocomplete activated
form.submit()
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
65
Case based critical thinking Case 13-4 Samantha is working on a web document. She wants to direct the browser to retrieve specific information about a URL, to reload the current page, and to load an entirely new page. Which of the following commands can Samantha use to load a new page in the current window?

A) window.location = url
B) url.window = location
C) window.url = location
D) location.url = window
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
66
Case based critical thinking Case 13-3 Thomas is working on reference forms and form fields. He wants to use event handlers that can respond to user actions within a form. He uses the element.onchange event handler. Identify the description of the event handler Thomas has used.

A) The element has received user input
B) The value of element has been modified
C) The element value is invalid
D) The form element has lost the focus
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
67
Match between columns
The element contains data whose character length exceeds the value of the length attribute.
element.validity.typeMismatch
The element contains data whose character length exceeds the value of the length attribute.
element.validity.tooLong
The element contains data whose character length exceeds the value of the length attribute.
element.validity.valid
The element contains data whose character length exceeds the value of the length attribute.
element.validity.patternMismatch
The element contains data whose character length exceeds the value of the length attribute.
element.validity.customError
The element contains data whose character length exceeds the value of the length attribute.
element.validity.badInput
The element contains valid data, satisfying all constraints.
element.validity.typeMismatch
The element contains valid data, satisfying all constraints.
element.validity.tooLong
The element contains valid data, satisfying all constraints.
element.validity.valid
The element contains valid data, satisfying all constraints.
element.validity.patternMismatch
The element contains valid data, satisfying all constraints.
element.validity.customError
The element contains valid data, satisfying all constraints.
element.validity.badInput
The field element, element , contains data that the browser is unable to convert.
element.validity.typeMismatch
The field element, element , contains data that the browser is unable to convert.
element.validity.tooLong
The field element, element , contains data that the browser is unable to convert.
element.validity.valid
The field element, element , contains data that the browser is unable to convert.
element.validity.patternMismatch
The field element, element , contains data that the browser is unable to convert.
element.validity.customError
The field element, element , contains data that the browser is unable to convert.
element.validity.badInput
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.typeMismatch
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.tooLong
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.valid
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.patternMismatch
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.customError
The element contains data that does not match the character pattern specified in the pattern attribute.
element.validity.badInput
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.typeMismatch
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.tooLong
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.valid
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.patternMismatch
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.customError
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
element.validity.badInput
The element contains data that does not match the data type specified by the type attribute.
element.validity.typeMismatch
The element contains data that does not match the data type specified by the type attribute.
element.validity.tooLong
The element contains data that does not match the data type specified by the type attribute.
element.validity.valid
The element contains data that does not match the data type specified by the type attribute.
element.validity.patternMismatch
The element contains data that does not match the data type specified by the type attribute.
element.validity.customError
The element contains data that does not match the data type specified by the type attribute.
element.validity.badInput
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
68
Case based critical thinking Case 13-4 Samantha is working on a web document. She wants to direct the browser to retrieve specific information about a URL, to reload the current page, and to load an entirely new page. Identify the object that Samantha should use to meet her desired requirements.

A) location
B) option
C) form
D) string
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
69
Case based critical thinking Case 13-2 Lisa can control the number of digits displayed by the browser using the toFixed() method. However, since the toFixed() method is limited to only defining the decimal place accuracy, she wants to use a method that gives her more control over the numeric format, such as formatting numbers as currency or separating thousands with the comma symbol. Which of the following methods should Lisa use to format the numbers as currency?

A) currency: code
B) toLocaleString()
C) useGroup: Boolean
D) element.oninput
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
70
Case based critical thinking Case 13-3 Thomas is working on reference forms and form fields. He wants to use event handlers that can respond to user actions within a form. He uses the element.onchange event handler. Which event handler should Thomas use for options buttons and check boxes in response to the user clicking those elements?

A) element.onfocus
B) element.onreset
C) element.onblur
D) element.onclick
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
71
Match between columns
Resets the web form
form.autocomplete
Resets the web form
form.length
Resets the web form
form.requestAutocomplete()
Resets the web form
form.reset()
Resets the web form
form.submit()
Initiates autocompletion of those form fields that have autocomplete activated
form.autocomplete
Initiates autocompletion of those form fields that have autocomplete activated
form.length
Initiates autocompletion of those form fields that have autocomplete activated
form.requestAutocomplete()
Initiates autocompletion of those form fields that have autocomplete activated
form.reset()
Initiates autocompletion of those form fields that have autocomplete activated
form.submit()
Submits the web form
form.autocomplete
Submits the web form
form.length
Submits the web form
form.requestAutocomplete()
Submits the web form
form.reset()
Submits the web form
form.submit()
Returns the number of elements in the form
form.autocomplete
Returns the number of elements in the form
form.length
Returns the number of elements in the form
form.requestAutocomplete()
Returns the number of elements in the form
form.reset()
Returns the number of elements in the form
form.submit()
Allows the browser to automatically complete form fields
form.autocomplete
Allows the browser to automatically complete form fields
form.length
Allows the browser to automatically complete form fields
form.requestAutocomplete()
Allows the browser to automatically complete form fields
form.reset()
Allows the browser to automatically complete form fields
form.submit()
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
72
Match between columns
Premises:
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
Returns the number of elements in the form
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
The element contains data that does not match the data type specified by the type attribute.
Submits the web form
Submits the web form
Submits the web form
Submits the web form
Submits the web form
Submits the web form
Submits the web form
Submits the web form
Submits the web form
Submits the web form
Submits the web form
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
The element contains valid data, satisfying all constraints.
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
Initiates autocompletion of those form fields that have autocomplete activated
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
The element contains data that does not match the character pattern specified in the pattern attribute.
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
Allows the browser to automatically complete form fields
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
The field element, element , contains data that the browser is unable to convert.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
A custom validation message has been set to a nonempty text string using the setCustomValidity() metho d.
Resets the web form
Resets the web form
Resets the web form
Resets the web form
Resets the web form
Resets the web form
Resets the web form
Resets the web form
Resets the web form
Resets the web form
Resets the web form
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
The element contains data whose character length exceeds the value of the length attribute.
Responses:
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
form.autocomplete
form.length
form.requestAutocomplete()
form.reset()
form.submit()
element.validity.typeMismatch
element.validity.tooLong
element.validity.valid
element.validity.patternMismatch
element.validity.customError
element.validity.badInput
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
73
Explain how the Luhn Algorithm can be used to test for legitimate card numbers.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
74
Explain how you can work with radio buttons and check boxes.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
75
Explain how you can work with selection lists.
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
76
Case based critical thinking Case 13-1 Sarah wants to set the value of an input control. She applies the element.value = value; expression. What does element signify in the expression that Sarah has used?

A) Reference to a form element
B) Index number of the form
C) Value to be stored in the element
D) Reference to a web form
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
77
Case based critical thinking Case 13-5 William is exploring the syntax of regular expressions. He learns that in the regular expression language, a word refers to any string of symbols consisting solely of word characters. He also learns that word boundaries are indicated by the \b symbol. He wants to use a pattern that matches any word that starts with the characters "great" such as "greater", "greatness", or "greatest" Which of the following patterns should William use to match any word that ends with "ust" such as "dust", "trust", or "must"?

A) /ust\b/
B) /\bust/
C) \bust/
D) /b\ust/
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
78
Case based critical thinking Case 13-2 Lisa can control the number of digits displayed by the browser using the toFixed() method. However, since the toFixed() method is limited to only defining the decimal place accuracy, she wants to use a method that gives her more control over the numeric format, such as formatting numbers as currency or separating thousands with the comma symbol. If Lisa uses minimumIntegerDigits: num method, which of the following is the correct range for num ?

A) 0 to 20
B) 1 to 20
C) 0 to 19
D) 1 to 21
Unlock Deck
Unlock for access to all 78 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 78 flashcards in this deck.