Web Development and Design Foundations with HTML5 (8th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
8th Edition
ISBN: 9780134322759
Author: Terry Felke-Morris
Publisher: PEARSON
Question
Book Icon
Chapter 14, Problem 6HOE
Program Plan Intro

Program Plan:

  • Include the HTML tag using “<html>”.
    • Include the heading tag using “<head>”.
      • Open the title tag using “<title>” with appropriate title and close the tag.
      • Set the “meta” tag using “<meta>”.
      • Open the style tag “<style>” to make style for HTML tags.
        • Make a style for “input” type.
          • Set the display as “block”.
          • Set the “margin-bottom” as “1em”.
        • Make a style for “label” element and set the properties of label.
        • Make a style for “submit” element with margin-left property.
    • Open the script tag using “<script>”.
      • Define the function named “validateForm()” to validate the user name, age and city.
        • Check the condition for user name, if user name is “Null” then display the alert message and return “false”.
        • Check the condition for age. If user’s age is less than 18 display the alert message and return “false”.
        • Check the condition for city input. If the input box for city is “Null” then display the alert message “City field cannot be empty” and return “false”.
      • Display the alert message for valid inputs and return “true”.
    • Close the script tag using “</script>”.
    • Close the head tag using “</head>”.
    • Open the heading tag with appropriate heading using “<h1>” tag and close it.
    • Open the form tag with “post” method, when the “onsubmit” event handler clicks by the user the “validateForm()” function called to validate the inputs.
    • Create the additional label and input type for “City” input.
    • Close the form tag using “</form>”.
    • Close the body tag using “</body>”.
  • Close the file using “</html>” tag.

Blurred answer
Students have asked these similar questions
Attached is image of the question. Make sure to answer all parts of the question correctly.
Make sure to answer all parts correctly. Attached is image of the question
Select the statement below that is true about forms. Select one: a. All of these are true. b. The <form> tag is optional. c. It is recommended to use mailto: as the action on a form since that is the easiest for the web developer. d. A form can be used to pass information to a program or script on the web server.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education