17.1 The onmouseover Event
The onMouseover event occurs when the user drags the mouse over certain elements of a web page, such as a hyperlink. In the following example, when the user drags the mouse over the hyperlink, a popup dialog will appear prompting he or she to click the OK button. After clicking the OK button, the user will be directed to the particular web page.
Click on Example 17.1 to view the output
17.2 The onsubmit Event
The onSubmit event is used to control the form submission process. It is usually used together with a Submit button on the web page. For example, you might want to remind that the user leaves a textbox empty or mistype something. You can write code to customize whatever you need to alert the user. For example, you can include the following code within the form tag to alert the user to enter his or her email address before the form is submitted:
A fully coded example is shown below. In this example, if the user forget to enter his or her name, a dialog will pop up to remind the user to fill up his or her name. Once the user has enter his or her name and press the submit button, a message will appear to tell the user that the submission is successful.
Click on Example 17.2 to check it out.