# Javascript: TXTextControl.InsertionMode Enumeration

> Determines how text is inserted at the current input position when text is typed or inserted.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Enumeration
- **Introduced:** 34.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TXTextControl.InsertionMode Enumeration
- **278 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/insertionmode-enumeration/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/insertionmode-enumeration/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/insertionmode-enumeration/llms-full.txt

---

### Description

Determines how text is inserted at the current input position when text is typed or inserted.

### Members

| Member | Description |
|---|---|
| Insert | Text is inserted at the current input position, and existing text is moved to the right. |
| Overwrite | Text at the current input position is overwritten by the newly inserted text. |

### Examples

The following example uses `TXTextControl.InsertionMode.Insert` (text is inserted at the current input position, and existing text is moved to the right.) in a document-editing workflow.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.setInsertionMode(
    TXTextControl.InsertionMode.Insert,
    function() {
        console.log("set insertion mode completed.");
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.inputPosition Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/inputposition-property/llms-full.txt)
- **Next:** [Javascript: TXTextControl.isHyphenationEnabled Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/ishyphenationenabled-property/llms-full.txt)
