Review questions0

docx

School

University of the Fraser Valley *

*We aren’t endorsed by this school

Course

145

Subject

Computer Science

Date

Jan 9, 2024

Type

docx

Pages

7

Uploaded by GeneralKingfisher3554

Report
Review Questions Multiple Choice 1. You would like to conduct a survey and ask your web page visitors to vote for their favorite search engine. Which of the following form controls is best to use for this purpose? a. check box b. radio button c. text box d. scrolling text box ANSWER: (b) 2. You would like to conduct a survey and ask your web page visitors to indicate the web browsers that they use. Which of the following form controls is best to use for this purpose? a. check box b. radio button c. text box d. scrolling text box ANSWER: (a) 3. Which attribute of the form element is used to specify the name and location of the script that will process the form field values? a. action b. process c. method d. id ANSWER: (a) 4. Choose the HTML tag that would configure a text box with the name “city” and a width of 40 characters. a. <input type="text" id="city" width="40"> b. <input type="text" name="city" size="40"> c. <input type="text" name="city" space="40"> d. <input type="text" width="40"> ANSWER: (b)
5. Which of the following form controls would be appropriate for an area that your visitors can use to type in their e-mail address? a. select list b. text box c. scrolling text box d. label ANSWER: (b) 6. Which of the following form controls would be appropriate for an area that your visitors can use to type in comments about your website? a. text box b. select list c. radio button d. scrolling text box ANSWER: (d) 7. Forms contain various types of , such as text boxes and buttons, which accept information from a web page visitor. a. hidden elements b. labels c. form controls d. legends ANSWER: (c) 8. Which HTML tag would configure a scrolling text box with the name “comments”, 2 rows, and 30 characters? a. <textarea name="comments" width="30" rows="2"> </textarea> b. <input type="textarea" size="30" name="comments" rows="2"> c. <textarea name="comments" rows="2" cols="30"> </textarea> d. <input type="comments" rows="2" name="comments" cols="30"> ANSWER: (c) 9. You would like to accept a number that’s in a range from 1 to 25. The user needs visual verification of the number they selected. Which of the following form controls is best to use for this purpose?
a. spinner b. check box c. radio button d. slider ANSWER: (a) 10. Choose the HTML that would associate a label displaying the text “E-mail:” with the e-mail text box. a. E-mail <input type="textbox" name="email" id="email"> b. <label>E-mail: </label><input type="text" name="email" id="email"> c. <label for="email">E-mail: </label> <input type="text" name="email" id="emailaddress"> d. <label for="email">E-mail: </label> <input type="text" name="email" id="email"> ANSWER: (d) 11. What will happen when a browser encounters a form control that it does not support? a. The computer will shut down. b. The browser will crash. c. The browser will display an error message. d. The browser will display an input text box. ANSWER: (d) Fill in the Blank 12. To limit the number of characters that a text box will accept, use the attribute. ANSWER: (maxlength) 13. To group a number of form controls visually on the page, use the element. ANSWER: (fieldset) 14. To cause a number of radio buttons to be treated as a single group, the value of the attribute must be identical.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
ANSWER: (name) Short Answer 15. Describe at least three form controls that could be used to allow a visitor to your web page to select a color. The color input type, utilizing the <input> element with the "color" attribute, allows users to conveniently choose colors through a dialog. Alternatively, radio buttons or checkboxes provide a straightforward interface for users to select from predefined color options. A dropdown menu, created with the <select> element, presents a more condensed selection method with a range of color choices. Apply Your Knowledge 1. PREDICT THE RESULT. Draw and write a brief description of the web page that will be created with the following HTML code: <!DOCTYPE html> <html lang="en"> <head> <title>Predict the Result</title> <meta charset="utf-8"> </head> <body> <h1>Contact Us</h1> <form action="myscript.php"> <fieldset><legend>Complete the form and a consultant will contact you.</legend> E-mail: <input type="text" name="email" id="email" size="40"> <br>Please indicate which services you are interested in:<br> <select name="inquiry" id="inquiry" size="1"> <option value="development">Web Development</option> <option value="redesign">Web Redesign</option> <option value="maintain">Web Maintenance</option> <option value="info">General Information</option> </select> <br> <input type="submit"> </fieldset> </form> <nav><a href="index.html">Home</a> <a href="services.html">Services</a> <a href="contact.html">Contact</a></nav> </body>
</html> ANSWER: The HTML code creates a "Contact Us" page featuring an email input and a dropdown menu for service inquiries. Upon submission, the form directs data to "myscript.php." The navigation section offers links to the home, services, and contact pages. The structure adheres to HTML5 standards, ensuring proper document definition. For a complete understanding of the user experience, the functionality of "myscript.php" would need to be examined, as it determines the outcome of form submissions and potential interactions with the server 2. FILL IN THE MISSING CODE. This web page configures a survey form to collect information on the favorite search engine used by web page visitors. The form action should submit the form to the server-side script, called survey.php. Some HTML tags and their attributes, indicated by <_> , are missing. Some HTML attribute values, indicated by "_" , are missing. <!DOCTYPE html> <html lang="en"> <head> <title>Fill in the Missing Code</title> <meta charset="utf-8"> </head> <body> <h1>Vote for your favorite Search Engine</h1> <form method="_" action="_"> <input type="radio" name="_" id="Ysurvey" value="Yahoo"> Yahoo!<br> <input type="radio" name="survey" id="Gsurvey" value="Google"> Google<br> <input type="radio" name="_" id="Bsurvey" value="Bing"> Bing<br> <_> </form> </body> </html> ANSWER: code in red is missing <!DOCTYPE html> <html lang="en"> <head>
<title>Fill in the Missing Code</title> <meta charset="utf-8"> </head> <body> <h1>Vote for your favorite Search Engine</h1> <form method=" post " action=" survey.php "> <input type="radio" name=" survey " id="Ysurvey" value="Yahoo"> Yahoo!<br> <input type="radio" name="survey" id="Gsurvey" value="Google"> Google<br> <input type="radio" name=" survey " id="Bsurvey" value="Bing"> Bing<br> < input type="submit" > </form> </body> </html> 3. FIND THE ERROR. Find the coding errors in the following subscription form: <!DOCTYPE html> <html lang="en"> <head> <title>Find the Error</title> <meta charset="utf-8"> </head> <body> <p>Subscribe to our monthly newsletter and receive free coupons!</p> <form action="get" method="newsletter.php"> <lable>E-mail: <input type="textbox" name="email" id="email" char="40"></lable> <br> <input button="submit"> <input type="rest"> </form> </body> </html> ANSWER : The HTML code has multiple errors: the form's action attribute is set to
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
"get" instead of a specific URL, a typo in the label tag ("lable" instead of "label"), an incorrect input type for email ("textbox" instead of "text"), and syntax errors in the submit and reset buttons. The corrected code specifies the proper action, fixes the label typo, adjusts the input type, and corrects the button syntax, ensuring the form functions correctly and follows HTML standards.