# Javascript: SignatureFieldCollection.addWithMouse Method

> Inserts a signature field with the built-in mouse interface. The signature field's size is determined through the end-user. A cross cursor indicates where the signature field can be inserted. Changing the document aborts the insertion process.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 31.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: SignatureFieldCollection.addWithMouse Method
- **340 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/signaturefieldcollection/addwithmouse-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/signaturefieldcollection/addwithmouse-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/signaturefieldcollection/addwithmouse-method/llms-full.txt

---

### Description

Inserts a signature field with the built-in mouse interface. The signature field's size is determined through the end-user. A cross cursor indicates where the signature field can be inserted. Changing the document aborts the insertion process.

### Syntax

```javascript
<void> SignatureFieldCollection.addWithMouse(<FrameInsertionMode> insertionMode, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| insertionMode | Specifies how the text flow is handled. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `SignatureFieldCollection.addWithMouse` in a practical document-editing workflow. It inserts a signature field with the built-in mouse interface. The signature field's size is determined through the end-user. A cross cursor indicates where the signature field can be inserted. Changing the document aborts the insertion process.

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

TXTextControl.signatureFields.addWithMouse(TXTextControl.FrameInsertionMode.AsCharacter, onTxError);
```

---

## Nearby

- **Previous:** [Javascript: SignatureFieldCollection.addInline Method](https://docs.textcontrol.com/ds-server/reference/javascript/signaturefieldcollection/addinline-method/llms-full.txt)
- **Next:** [Javascript: SignatureFieldCollection.getItem Method](https://docs.textcontrol.com/ds-server/reference/javascript/signaturefieldcollection/getitem-method/llms-full.txt)
