Chapter 6 Flashcards
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
True
T/F By default, browsers create an collection of form objects that you can reference using array notation
True
T/F Assistive functions perform a type of validation
False
T/F You can use HTML to set the default value of a selection list so no option is selected
False
T/F Modern browsers can perform many validation tasks themselves without any extra JavaScript
True
To check if an option button is selected, you access the value of its BLANK property
checked
To display no default value on a selection list, you set its BLANK property to -1
selectedIndex
Many aspects of the way browsers present browser-based validation feedback are customizable through the properties and methods of the BLANK
constraint validation API
The BLANK event fires when a form is submitted
submit
You use the BLANK method on an object to block the action normally associated with an event
preventDefault()
The BLANK form element is useful for limiting user options to a set of choices
selection list
You create an empty document fragment using the BLANK method
createDocumentFragment()
The BLANK attribute enhances usability in modern browsers
placeholder
What element property would you use when copying the contents of one text field to another text field
value
Which attribute toggles off validation of a form when added to the opening tag?
novalidate
Which type value for the input element triggers validation in modern browswers?
number
In modern browsers, which attribute of an input element prevents the form from being submitted if the field is left blank
required
Validation errors found by modern browsers are reported in BLANK
bubbles
In general, modern browsers display validation feedback after the BLANK event is trigged by a form
submit
You can use the CSS BLANK pseudo-classes to change the properties of form elements based on their validity status
:invalid and :valid
To check a group of fields and trigger an error message if an of them is empty, you use a(n) BLANK statement
loop
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
isNaN()
When a control’s value is found to be invalid during constraint validation, the BLANK event is triggered
invalid
Instead of document.getElementsByTagName(“form”)[0], you could use the code
document.forms[0]