Form handling onsubmit, onchange, onselect, onblur, onfocus

1. Introduction

After completing this module, you are expected to:

  • Design a simple form as user information input
  • Create a dynamic web form

          Last quarter, we learned about events where certain actions are triggered when certain events happen on a web page. These events are tested in the JS code through the use of event handlers and one example is onclick. This is used to call a block of JS code to be executed when an HTML element is clicked.

          In this module, we will discuss other  event handlers that can be used to make websites more interactive. We will focus particularly on event handlers that are applicable to HTML forms. By adding event handlers to HTML forms, we can engage the user more and we can process the data provided by the user. Processing data from forms and input elements is called form handling. Alongside these HTML event handlers, we will also learn about the different ways that input from forms can be handled for processing using JS.

          This learning guide will discuss five different event handlers to track user actions. Processing of values from forms will also be demonstrated in the sample codes.