Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
9th Edition
ISBN: 9780134801148
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
Most forms on websites will usually have some sort of test to confirm that the user is a human and not a bot. Update the contact form that you created in Part 3. Add a field to the form that asks the user for the answer to a simple maths problem. The form should only be submitted if the user provides the successful answer to the maths problem. For example you may ask the user what 3 + 4 equals. The form will only be successfully submitted if the user provides 7 as the answer. If the user provides the incorrect answer to the maths problem, you should display a bold red error message to the user on the page by manipulating the DOM. The message should be diplayed in the same location on the page as the form validation error message from Part 3. If the user provides the correct answer to the maths problem, then the form should be submitted and the user should receive the bold green success message from part 3. Once part 4 is complete the user should receive an error message if: • The form…
Write JavaScript codes to validate a name text field so that when a user submits the form with the name field empty or with numeric value an alert message should be displayed to the user. The form submission should be accepted when the user enters a non-numeric value with a success alert message.
That answer is wrong. Can you please read the instructions.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning