---
title: "edit-text"
description: "Overview"
permalink: /docs/build/ui-components/all-ui-components/object-table/column/edit-text/
---
# edit-text

## Overview

<Info>

To get started, see the introductory [guide](/docs/build/ui-components/all-ui-components/object-table/object-table-guides/edit-cells/) on editable `object-table` cells.

</Info>

`edit-text` is the simplest type of editable cells. This cell type is used when the data captured requires standard `utf-8` input. The data allows for line breaks and is treated as a `textarea`, as opposed to a `textfield`.

<Info>

**On Desktop**: Pressing `enter` will cause a line break, and pressing `[shift]` + `enter` will fire the submit event.

</Info>

### Basic Example

```xml
<object-table ...>
    <column display="{field}">
        <edit-text value="$object.field" on-change="$:valueChanged($object, newValue, oldValue)" />
    </column>
</object-table>
```

## Standard Attributes

### `on-change`

<SyntaxCard defaultValue={"unset"} />

A JavaScript/TypeScript [`$:function`](/docs/app-features/calling-js-functions-from-xml/) that executes when a cell's value is updated (once the user hits enter).

**main.view\.xml**

```xml
<object-table ...>
    <column heading="Editable field" display="{name}">
        <edit-text on-change="$:valueChanged($object, newValue, oldValue)" />
    </column>
</object-table>
```

**main.js**

```javascript
function valueChanged(object, newValue, oldValue){
    object.name = newValue;
    object.save();
}
```

### `value`

<SyntaxCard defaultValue={"unset"} required />

The object field or result of a [`$:function`](/docs/app-features/calling-js-functions-from-xml/) which is the initial editable value shown when the user edits the cell. Valid values are:

* `value="$object.[field]"`
* `value="$:getInitialEditingValue($object)"`

<Warning>

Unlike `display`, `value` is **not** a text attribute and must therefore represent a variable or result of a function, i.e. do not use string literals to give it a value in curly brackets like this: `value="{do_not_do_this}"`

</Warning>

## Advanced Attributes

### `clear-button-visibility`

<AttributeReference label="clear-button-visibility" href="/docs/build/ui-components/common-attributes/clear-button-visibility/" badge="advanced" tone="muted" />

### `disabled`

<SyntaxCard type={"boolean"} defaultValue={"false"} />

When a particular editable cell should not be editable based on a condition, the `disabled` attribute can be used to dynamically turn it into a standard display-only cell. This attribute has access to `$object`.

Also see:

<AttributeReference label="disabled" href="/docs/build/ui-components/common-attributes/disabled/" badge="advanced" tone="muted" />
