You are here: Reference > JavaScript > client-side > event handling > properties > dataFld (event)

dataFld property (event)

Browser support:
Sets or returns the name of the modified data column in case of the oncellchange event.
This property can be used if the contents of a cell within a dynamic table (created with data binding techniques) have changed.

Syntax:

object.dataFld;
You can find the related objects in the Supported by objects section below.
This property is read/write.

Possible values:

String that sets or returns the name of the data column.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the dataFld property:
<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