CIS 223 Ch 6
Which of the following will substitute an image named redButton.jpg that is stored in the same place as the web page for a generic button? The doStuff() function is called when the button is clicked.
<a href="Javascript:doStuff()"> <img src = "redButton.jpg"> </a>
Which of the following will send form results from a form named "importantInfo" to the email address [email protected] with the subject "Read this!"
<form name="importantInfo" method="post" id="info" action= "mailto:[email protected]?subject=Read this!" enctype="plain/text">
Where are <form></form> tags placed?
Anywhere in the body of a web page
Which of the following are ways to submit form data?
all of these
Which of the following is the correct way to set a background color of blue to an HTML element with id = "color_change"?
document.getElementById("color_change").style.background = "blue";
CGI scripts are normally saved in a folder named cgi-bin that exists on every client's hard drive.
false
Radio buttons are used to allow users to select several options at one time.
false
The properties that determine the size of a text box are cols and rows.
false
The property of each radio button in a group of radio buttons that must be the same for each button is the id property.
false
The two types of buttons that display masked text (such as *'s or #'s) to hide what a user enters are "hidden" and "password".
false
Which line of code will check if any character in the string variable pword is the letter X and return true for the variable check? var check = false; for (i = 0; i < pword.length; i++) { _____???_______ check = true; }
if (var charX.charAt[i] == "X");
Which of the following checks if the sixth character of a string variable named myMail is the @ sign using a Boolean variable named atSign set to true if this is true?
if(myMail.substr(5, 1) == "@") atSign = true;
Which of the following checks to see if the number of characters in a given string named myName is greater than 2 and less than 11?
if(myName.length > 2 && myName.length < 11)
When using a set of radio buttons, which attribute must be the same for all buttons in the set
name
Which of the following will call a function named setBlue() when a text box with id = "blue" gets the focus?
onfocus = "setBlue('blue')"
Which line of code should be used to make the following code snippet work? var longString = "Great day, isn't it?"; var shortString = _____???_______ document.write("It's going ton rain to" + shortString);
shortString = longString.substr(6, 3);
Buttons that can be automatically created using the type attribute are:
submit, reset and hidden
Which of the following sets or changes the tab order of form controls?
tab index
Given the following line of code, what does the this keyword refer to? <input type = "button" name = "murgatroyd" id = "Mortimer" onclick = "doSomething(this.id)" />
the id attribute
A form using the <form></form> tag pair can be placed anywhere within a web page.
true
If the information entered into a textarea box exceeds the number of rows originally set, a scroll bar is created.
true
The Common Gateway Interface (CGI) allows web pages to be generated as executable files.
true
The checked property can be used to return the state of a checkbox to a JavaScript function.
true
When a form is enhanced with JavaScript, an event handler must be used to evoke the JavaScript code.
true
Which of the following will check to see if a password contains a # sign, given that the character code for "#" is 37? The password is 8 characters long and is stored in a variable named pword.
var check = false; for (j = 0; j < 8; j++) { if (pword.charCodeAt(j) == 37) check = true; }