# Javascript: TXTextControl.setActivationState Method

> Sets a value indicating the current activation state. It can be activated, deactivated or disabled.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: TXTextControl.setActivationState Method
- **355 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/setactivationstate-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/setactivationstate-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/setactivationstate-method/llms-full.txt

---

### Description

Sets a value indicating the current activation state. It can be activated, deactivated or disabled.

### Syntax

```javascript
<void> TXTextControl.setActivationState(<ActivationState> activationState, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| activationState | Indicates the current activation state. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TXTextControl.setActivationState` in a practical document-editing workflow. It sets a value indicating the current activation state. It can be activated, deactivated or disabled.

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

TXTextControl.setActivationState(
    TXTextControl.ActivationState.Activated,
    function() {
        console.log("set activation state completed.");
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.selectWord Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/selectword-method/llms-full.txt)
- **Next:** [Javascript: TXTextControl.setAllowDrag Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/setallowdrag-method/llms-full.txt)
