# Javascript: DateFormField.getEmptyWidth Method

> Gets the horizontal extension, in twips, of the date formfield, when it is empty.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: DateFormField.getEmptyWidth Method
- **346 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/getemptywidth-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/getemptywidth-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/getemptywidth-method/llms-full.txt

---

### Description

Gets the horizontal extension, in twips, of the date formfield, when it is empty.

### Syntax

```javascript
<void> DateFormField.getEmptyWidth(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the horizontal extension, in twips, of the date formfield, when it is empty. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `DateFormField.getEmptyWidth` in a practical document-editing workflow. It gets the horizontal extension, in twips, of the date formfield, when it is empty.

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

function inspectEmptyWidth(dateFormField) {
    dateFormField.getEmptyWidth(
        function(result) {
            console.log("get empty width result:", result);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: DateFormField.getDateFormat Method](https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/getdateformat-method/llms-full.txt)
- **Next:** [Javascript: DateFormField.getSupportedDateFormats Method](https://docs.textcontrol.com/ds-server/reference/javascript/dateformfield/getsupporteddateformats-method/llms-full.txt)
