• Unit 5: Introduction to Forms in JavaScript

    Filling out information on web pages is often required when shopping online or registering for something. This involves using drop-down menus to select states or radio buttons/checkboxes for choosing options. Forms are used for entering this information and are essential to web application development. This final unit will cover the basics of forms and their properties, including how to create buttons, checkboxes, radio, and text elements and how they are used with HTML, CSS, the Document Object Model, and JavaScript functions, and Events. You will also learn how to style and validate their data since forms must be user-friendly and accurately store received data.

    Completing this unit should take you approximately 4 hours.

    • 5.1: Introduction to Web Forms

      The <form> HTML element represents a document section containing interactive controls for submitting information. The HTML form element is used inside a <form> tag. There are many form elements that you can use. The following sections cover the <form>, <input>, <label>, and <select> elements. These elements are implemented using the DOM HTMLElement interfaces described in the other unit.  Note that this section requires knowledge of HTML and CSS. 

    • 5.2 How to Use Button and Text Elements

      Creating button and text elements is crucial for building interactive web pages that rely on user input. The articles in this section demonstrate how to create and use both elements and provide an example of using the JavaScript click() event in an interactive webpage.

    • 5.3: How To Use Checkboxes and Radio Buttons

      Checkboxes and radio buttons provide an interactive way for users to make selections. When you do not want to leave input open-ended, you can require users to choose from pre-selected options that limit their choices. The articles and video in this section show how to use JavaScript with checkboxes and radio button elements.  

    • 5.4: Styling Custom Forms

      When designing a web page, you may need to make it custom and use specific styles to make it work correctly and look appealing. The styling of these custom pages may take time and effort. Knowing how to style all different forms is good for making your web page stand out.

    • 5.5: Using JavaScript for AutoCompletion

      Autocompletion is a nice feature to implement in web forms using JavaScript. This feature allows for assistance when entering information in form fields. You can use the DOM to populate form elements with data so that users can quickly select items.

    • 5.6: JavaScript and Form Validation

      Before submitting data to the server, it is important to ensure that all required form controls are filled out and in the correct format. Client-side validation is an initial check and an important feature of a good user experience. By catching invalid data on the client side, the user can fix it immediately. If the data gets to the server and is rejected, a noticeable delay is caused by a round trip to the server and then back to the client side to tell the user to fix their input.

    • 5.7: Final Practice Exercise

      Now that you have worked through this course, we will examine a few case studies. Each of these exercises will have a solution for you to download.

    • Unit 5 Assessment

      • Receive a grade