Deck 8: Creating Forms With Javascript

Full screen (f)
exit full mode
Question
A stereo button is an input control that allows the user to select any number of options from a set of options.
Use Space or
up arrow
down arrow
to flip the card.
Question
Returning a value means that whenever any other function calls this function,its name is essentially replaced by the value it returns.
Question
When the server receives the form data,it is processed by another program that is typically written in ASP,JSP,PHP,or some other ____ scripting/programming language.

A) client-side
B) server-side
C) form-specific
D) browser-specific
Question
JavaScript statements can use a single equal sign ( = )or two equal signs ( == ).
Question
In addition to using the Backspace or Delete key to correct mistakes,it is customary for Web page designers to include some type of clear ____ that allows the user to erase all form entries with a single click and start over.

A) wizard
B) button
C) menu
D) shortcut
Question
For many years,the C and C++ languages have been criticized because they allow the programmer to easily confuse the assignment operator with the comparison operator.____________________
Question
Server-side script looks a lot like JavaScript code,but it is processed in a very different fashion.
Question
JavaScript is capable of sending information to another location.This data transfer normally travels through a(n)HTML connection,eventually arriving at a Web server somewhere.____________________
Question
If the user forgets to fill out a portion of a form,it is an easy task for JavaScript to detect the absence of required data and alert the user accordingly.
Question
Server-script programs are capable of many different functions,but they are most frequently used to update a transaction system.____________________
Question
Practically every business that provides its customers with electronic forms that collect data has the need to ____ the data to ensure that customers have entered appropriate and complete information.

A) scan
B) validate
C) correct
D) process
Question
There are several JavaScript events that can be used to add some "intelligence" to simple HTML form components.
Question
The NOT operator is most commonly used when the programmer wants to test for a true condition.
Question
Returning a value means that whenever any other function calls this function (such as the doSubmit()function),its name is essentially replaced by the value it returns.____________________
Question
To create an effective order form,you must first define its appearance on the Web page by using the appropriate JavaScript tags.
Question
To validate the contents of a text field,the program checks the contents of the object's name property to see if it contains an empty string.____________________
Question
You name each of the interactive objects in an HTML form (also called ____)so that they can be referenced within JavaScript code.

A) components
B) pieces
C) parcels
D) packets
Question
A meaningless sequence of gibberish or cryptic symbols can be a string,and there is virtually no limit to the length of a string.
Question
Like C,C++,and Java,JavaScript gives you the ability to invert the value of a logical variable with the NO operator (&).
Question
A ____ button is an input control that allows the user to select just one option from a set of options.

A) television
B) choice
C) radio
D) choose
Question
____________________ is the process of checking user input data to make sure that it is complete and accurate.
Question
You begin the process of creating a fully functional,robust form by ____.

A) identifying the various objects in the HTML form with which the users interact
B) defining the general layout of the form on a Web page
C) writing the JavaScript functions that are invoked when the user triggers a specific JavaScript event
D) giving each of these interactive objects a name
Question
In the case of C,C++,Java,and JavaScript,the assignment operation is accomplished with the ____ character(s).

A) "="
B) "= ="
C) "+"
D) "+ +"
Question
Old-style stereo systems used mechanical radio buttons that were usually ____,so the Windows programmers gave this shape to their radio buttons.

A) square
B) round
C) oval
D) rectangle
Question
Case 8-1
Carmella is putting together an order processing system for her local pizza parlor, Pete's Italian Pies.
In the JavaScript below,Carmella realizes that the doSubmit()function does nothing more than invoke the JavaScript ____ method.
< script>
Function doSubmit()
{
Alert("Your pizza order has been submitted.");
Return;
}
< /script>

A) script()
B) alert()
C) submit()
D) function()
Question
A string can consist of ____.

A) a single word
B) a complete sentence
C) an entire chapter of a book
D) all of the above
Question
In the case of C,C++,Java,and JavaScript,the comparison operation is accomplished with the < sup> < /sup>____ character(s).

A) "="
B) "= ="
C) "+"
D) "+ +"
Question
FIGURE 8-2
<strong>FIGURE 8-2   Referring to Figure 8-2 above,which of the following statements is NOT true ____.</strong> A) The section contains a heading B) The section contains three radio buttons C) The radio buttons have different labels D) The radio buttons have different names <div style=padding-top: 35px>
Referring to Figure 8-2 above,which of the following statements is NOT true ____.

A) The section contains a heading
B) The section contains three radio buttons
C) The radio buttons have different labels
D) The radio buttons have different names
Question
The ____ attribute of input controls can be "text," "radio," or "checkbox."

A) value
B) text
C) string
D) type
Question
Case 8-2
David is adding a clear form feature to the Pete's Italian Pies Web site, and has written the following code:
function doClear() {
document.PizzaForm.customer.value = "";
}
Referring to David's JavaScript above,the text control is assigned the name ____,and it is an element within the form object that you named PizzaForm.

A) document
B) Pizza
C) value
D) customer
Question
Case 8-1
Carmella is putting together an order processing system for her local pizza parlor, Pete's Italian Pies.
In testing the JavaScript below,Carmella discovers that the onClick event looks and acts like the ____ events she used in another project.
< input type="button" value="Submit Order" onClick="doSubmit()">

A) onMouseOver
B) onMouseOut
C) onLoad
D) all of the above
Question
A completed form consists of headings,labels,and user ____ controls.

A) output
B) input
C) message
D) alert
Question
You can invert a true value to false or a false value to true by placing a single ____ in front of the variable.

A) !
B) $
C) %
D) +
Question
Case 8-2
David is adding a clear form feature to the Pete's Italian Pies Web site, and has written the following code:
function doClear() {
document.PizzaForm.customer.value = "";
}
Referring to David's JavaScript above,the form object is contained with the ____ object.

A) document
B) Pizza
C) value
D) customer
Question
Whenever a variable (or ____ return value)is being compared to the false value (== false),the comparison can be shortened by using the ! operator instead.

A) function
B) form
C) property
D) operator
Question
A JavaScript function can be invoked (or ____)when the user clicks the Submit Order button.

A) called
B) signaled
C) invited
D) stored
Question
To get the Submit Order button to call a JavaScript function when it is clicked,you need to make use of a JavaScript ____.

A) event
B) method
C) parameter
D) property
Question
FIGURE 8-1
<strong>FIGURE 8-1   Referring to Figure 8-1 above,the following field is NOT left-aligned using a non-breaking space ____.</strong> A) Name B) State C) Phone D) City <div style=padding-top: 35px>
Referring to Figure 8-1 above,the following field is NOT left-aligned using a non-breaking space ____.

A) Name
B) State
C) Phone
D) City
Question
With ____ you will receive a compilation error if you attempt to use the wrong operator.

A) C and C++
B) JavaScript
C) Java
D) all of the above
Question
The validateText()function can only return one of two possible values: ____.

A) false or true
B) no or yes
C) null or void
D) fail or pass
Question
MATCHING
Identify the letter of the choice that best matches the phrase or definition.
a.Check box
b.String
c.Controls
d.Radio button
e.Text field
Interactive objects in an HTML form
Question
MATCHING
Identify the letter of the choice that best matches the phrase or definition.
a.Check box
b.String
c.Controls
d.Radio button
e.Text field
Sequence of one or more characters
Question
To validate a set of radio buttons,you need to test the value of each object's ____________________ property to see if it is set to true or false.
Question
MATCHING
Identify the letter of the choice that best matches the phrase or definition.
a.Check box
b.String
c.Controls
d.Radio button
e.Text field
Input control that allows the user to select just one option from a set of options
Question
The JavaScript event called ____________________ is triggered whenever an input control of type button is clicked.
Question
It is essential for programmers to give the user some kind of visual or auditory clue as to what the program is doing or when it has completed its operation.Name five different ways that you can be notified by a program of its status.Imagine that you were selling circus tickets online.What are two ways you could notify users of the purchase process status?
Question
MATCHING
Identify the letter of the choice that best matches the phrase or definition.
a.Check box
b.String
c.Controls
d.Radio button
e.Text field
Input control that allows the user to enter a string value into a specific location on the Web page
Question
The term radio button has been around the software industry ever since Microsoft introduced its ____________________ operating system in the late 1980s.
Question
The validateText()function returns a(n)____________________.
Question
MATCHING
Identify the letter of the choice that best matches the phrase or definition.
a.Check box
b.String
c.Controls
d.Radio button
e.Text field
Input control that allows the user to select any number of options from a set of options
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 8: Creating Forms With Javascript
1
A stereo button is an input control that allows the user to select any number of options from a set of options.
False
2
Returning a value means that whenever any other function calls this function,its name is essentially replaced by the value it returns.
True
3
When the server receives the form data,it is processed by another program that is typically written in ASP,JSP,PHP,or some other ____ scripting/programming language.

A) client-side
B) server-side
C) form-specific
D) browser-specific
B
4
JavaScript statements can use a single equal sign ( = )or two equal signs ( == ).
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
In addition to using the Backspace or Delete key to correct mistakes,it is customary for Web page designers to include some type of clear ____ that allows the user to erase all form entries with a single click and start over.

A) wizard
B) button
C) menu
D) shortcut
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
For many years,the C and C++ languages have been criticized because they allow the programmer to easily confuse the assignment operator with the comparison operator.____________________
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
Server-side script looks a lot like JavaScript code,but it is processed in a very different fashion.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
JavaScript is capable of sending information to another location.This data transfer normally travels through a(n)HTML connection,eventually arriving at a Web server somewhere.____________________
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
If the user forgets to fill out a portion of a form,it is an easy task for JavaScript to detect the absence of required data and alert the user accordingly.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
Server-script programs are capable of many different functions,but they are most frequently used to update a transaction system.____________________
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
Practically every business that provides its customers with electronic forms that collect data has the need to ____ the data to ensure that customers have entered appropriate and complete information.

A) scan
B) validate
C) correct
D) process
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
There are several JavaScript events that can be used to add some "intelligence" to simple HTML form components.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
The NOT operator is most commonly used when the programmer wants to test for a true condition.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
Returning a value means that whenever any other function calls this function (such as the doSubmit()function),its name is essentially replaced by the value it returns.____________________
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
To create an effective order form,you must first define its appearance on the Web page by using the appropriate JavaScript tags.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
To validate the contents of a text field,the program checks the contents of the object's name property to see if it contains an empty string.____________________
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
You name each of the interactive objects in an HTML form (also called ____)so that they can be referenced within JavaScript code.

A) components
B) pieces
C) parcels
D) packets
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
A meaningless sequence of gibberish or cryptic symbols can be a string,and there is virtually no limit to the length of a string.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
Like C,C++,and Java,JavaScript gives you the ability to invert the value of a logical variable with the NO operator (&).
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
A ____ button is an input control that allows the user to select just one option from a set of options.

A) television
B) choice
C) radio
D) choose
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
____________________ is the process of checking user input data to make sure that it is complete and accurate.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
You begin the process of creating a fully functional,robust form by ____.

A) identifying the various objects in the HTML form with which the users interact
B) defining the general layout of the form on a Web page
C) writing the JavaScript functions that are invoked when the user triggers a specific JavaScript event
D) giving each of these interactive objects a name
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
In the case of C,C++,Java,and JavaScript,the assignment operation is accomplished with the ____ character(s).

A) "="
B) "= ="
C) "+"
D) "+ +"
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
Old-style stereo systems used mechanical radio buttons that were usually ____,so the Windows programmers gave this shape to their radio buttons.

A) square
B) round
C) oval
D) rectangle
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
Case 8-1
Carmella is putting together an order processing system for her local pizza parlor, Pete's Italian Pies.
In the JavaScript below,Carmella realizes that the doSubmit()function does nothing more than invoke the JavaScript ____ method.
< script>
Function doSubmit()
{
Alert("Your pizza order has been submitted.");
Return;
}
< /script>

A) script()
B) alert()
C) submit()
D) function()
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
A string can consist of ____.

A) a single word
B) a complete sentence
C) an entire chapter of a book
D) all of the above
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
In the case of C,C++,Java,and JavaScript,the comparison operation is accomplished with the < sup> < /sup>____ character(s).

A) "="
B) "= ="
C) "+"
D) "+ +"
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
FIGURE 8-2
<strong>FIGURE 8-2   Referring to Figure 8-2 above,which of the following statements is NOT true ____.</strong> A) The section contains a heading B) The section contains three radio buttons C) The radio buttons have different labels D) The radio buttons have different names
Referring to Figure 8-2 above,which of the following statements is NOT true ____.

A) The section contains a heading
B) The section contains three radio buttons
C) The radio buttons have different labels
D) The radio buttons have different names
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
The ____ attribute of input controls can be "text," "radio," or "checkbox."

A) value
B) text
C) string
D) type
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
Case 8-2
David is adding a clear form feature to the Pete's Italian Pies Web site, and has written the following code:
function doClear() {
document.PizzaForm.customer.value = "";
}
Referring to David's JavaScript above,the text control is assigned the name ____,and it is an element within the form object that you named PizzaForm.

A) document
B) Pizza
C) value
D) customer
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
Case 8-1
Carmella is putting together an order processing system for her local pizza parlor, Pete's Italian Pies.
In testing the JavaScript below,Carmella discovers that the onClick event looks and acts like the ____ events she used in another project.
< input type="button" value="Submit Order" onClick="doSubmit()">

A) onMouseOver
B) onMouseOut
C) onLoad
D) all of the above
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
A completed form consists of headings,labels,and user ____ controls.

A) output
B) input
C) message
D) alert
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
You can invert a true value to false or a false value to true by placing a single ____ in front of the variable.

A) !
B) $
C) %
D) +
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
Case 8-2
David is adding a clear form feature to the Pete's Italian Pies Web site, and has written the following code:
function doClear() {
document.PizzaForm.customer.value = "";
}
Referring to David's JavaScript above,the form object is contained with the ____ object.

A) document
B) Pizza
C) value
D) customer
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
Whenever a variable (or ____ return value)is being compared to the false value (== false),the comparison can be shortened by using the ! operator instead.

A) function
B) form
C) property
D) operator
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
A JavaScript function can be invoked (or ____)when the user clicks the Submit Order button.

A) called
B) signaled
C) invited
D) stored
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
To get the Submit Order button to call a JavaScript function when it is clicked,you need to make use of a JavaScript ____.

A) event
B) method
C) parameter
D) property
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
FIGURE 8-1
<strong>FIGURE 8-1   Referring to Figure 8-1 above,the following field is NOT left-aligned using a non-breaking space ____.</strong> A) Name B) State C) Phone D) City
Referring to Figure 8-1 above,the following field is NOT left-aligned using a non-breaking space ____.

A) Name
B) State
C) Phone
D) City
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
With ____ you will receive a compilation error if you attempt to use the wrong operator.

A) C and C++
B) JavaScript
C) Java
D) all of the above
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
The validateText()function can only return one of two possible values: ____.

A) false or true
B) no or yes
C) null or void
D) fail or pass
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
MATCHING
Identify the letter of the choice that best matches the phrase or definition.
a.Check box
b.String
c.Controls
d.Radio button
e.Text field
Interactive objects in an HTML form
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
MATCHING
Identify the letter of the choice that best matches the phrase or definition.
a.Check box
b.String
c.Controls
d.Radio button
e.Text field
Sequence of one or more characters
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
To validate a set of radio buttons,you need to test the value of each object's ____________________ property to see if it is set to true or false.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
MATCHING
Identify the letter of the choice that best matches the phrase or definition.
a.Check box
b.String
c.Controls
d.Radio button
e.Text field
Input control that allows the user to select just one option from a set of options
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
The JavaScript event called ____________________ is triggered whenever an input control of type button is clicked.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
It is essential for programmers to give the user some kind of visual or auditory clue as to what the program is doing or when it has completed its operation.Name five different ways that you can be notified by a program of its status.Imagine that you were selling circus tickets online.What are two ways you could notify users of the purchase process status?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
MATCHING
Identify the letter of the choice that best matches the phrase or definition.
a.Check box
b.String
c.Controls
d.Radio button
e.Text field
Input control that allows the user to enter a string value into a specific location on the Web page
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
The term radio button has been around the software industry ever since Microsoft introduced its ____________________ operating system in the late 1980s.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
The validateText()function returns a(n)____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
MATCHING
Identify the letter of the choice that best matches the phrase or definition.
a.Check box
b.String
c.Controls
d.Radio button
e.Text field
Input control that allows the user to select any number of options from a set of options
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.