Form.handleEvent() : Form Object « Form « JavaScript Tutorial

Home
JavaScript Tutorial
1.Language Basics
2.Operators
3.Statement
4.Development
5.Number Data Type
6.String
7.Function
8.Global
9.Math
10.Form
11.Array
12.Date
13.Dialogs
14.Document
15.Event
16.Location
17.Navigator
18.Screen
19.Window
20.History
21.HTML Tags
22.Style
23.DOM Node
24.Drag Drop
25.Object Oriented
26.Regular Expressions
27.XML
28.GUI Components
29.Dojo toolkit
30.jQuery
31.Animation
32.MS JScript
JavaScript Tutorial » Form » Form Object 
10.2.7.Form.handleEvent()

Syntax

form.handleEvent(event)

The handleEvent() method invokes the handler for the specified event.

It takes one parameter, which is the event to be handled.

<html>
    <head>
    <title> Using the handleEvent method of the Form object</title>
    </head>
    <body>
    <script language = "JavaScript">
    <!--
    function handleMyClick(evnt){
        window.document.button1.handleEvent(evnt);
    }
    function displayMsg(){
         document.form1.msg.value += "Click event occurred.\n";
    }
    document.onclick = handleMyClick;
    -->
    </script>
    <form name="form1">
    <input type="button" value="Click on Me" name="button1" onClick='displayMsg()'>
    <br><br>
    <textarea name="msg" rows="10" cols="50" onClick='displayMsg()'></textarea>
    </form>
    </body>
    </html>
10.2.Form Object
10.2.1.Form
10.2.2.Using the Forms Array
10.2.3.Form.action
10.2.4.Form.elements
10.2.5.Form.elements.length
10.2.6.form.encoding
10.2.7.Form.handleEvent()
10.2.8.Form.length
10.2.9.Form.method
10.2.10.Form.name
10.2.11.Form.onReset
10.2.12.Form.onSubmit
10.2.13.Form.reset()
10.2.14.Form.submit()
10.2.15.Form.target
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.