You are here: Reference > JavaScript > client-side > event handling > events > oncellchange

oncellchange event | cellchange event

Browser support:
Occurs on a data source object when the data in it has changed.
Note: there is no relationship between the oncellchange event and the HTML cell element. This event is a part of the data binding techniques in Internet Explorer.
For further details about data source objects, see the page for the recordset object.

How to register:

In HTML:
<ELEMENT oncellchange="handler">

In JavaScript:
object.oncellchange = handler;
object.attachEvent ("oncellchange", handler);
You can find the related objects in the Supported by objects section below.
The event object is accessible to all event handlers in all browsers. The properties of the event object contain additional information about the current event. To get further details about these properties and the possible event handler registration methods, please see the page for the event object.
For a complete list of events, see the page for Events in JavaScript.

Basic information:

Bubbles Yes
Cancelable No
Event object -

Actions that invoke the oncellchange event:

  • When a data changes in the data source object.

Example HTML code 1:

This example illustrates the use of the oncellchange event:
<head>
    <script type="text/javascript">
        function OnDataFieldChange (event) {
            alert ("The '" + event.dataFld + "' field of a movie record has changed within the data source object.");
        }
    </script>
</head>
<body>
    <xml id="movies" oncellchange="OnDataFieldChange (event);">
    <?xml version="1.0"?>
        <movies>
            <movie>
                <name>Clark Kent</name>
                <jobtitle>Superman</jobtitle>
                <born>1966</born>
            </movie>
            <movie>
                <name>Lois Lane</name>
                <jobtitle>Reporter</jobtitle>
                <born>1964</born>
            </movie>
        </movies>
    </xml>

    Modify the contents of an input field and click outside the field.
    <br /><br />
    <table>
        <tbody>
            <tr>
                <td>Name: <input datafld="name" type="text" datasrc="#movies" /></td>
                <td>Jobtitle: <input datafld="jobtitle" type="text" datasrc="#movies" /></td>
            </tr>
        </tbody>
    </table>
    <br /><br />
    <table width="100%" cellpadding="0px" cellspacing="2px" border="1px" datasrc="#movies" datapagesize="2">
        <thead>
            <tr>
                <th>Name</th>
                <th>Jobtitle</th>
                <th>Born</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td><input datafld="name" /></td>
                <td><input datafld="jobtitle" /></td>
                <td><input datafld="born" /></td>
            </tr>
        </tbody>
    </table>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content