# DateFormField Object

> A DateFormField object represents a date field on a form. It can be initially empty and it can have a horizontal extension, when it is empty. When a date field is clicked or entered through the keyboard's arrow keys a date control is shown where the user can select a date. When the date field is clicked again or the Escape key is pressed the date control is removed and the user can insert or change the date with the keyboard. The date is formatted depending on the culture used for the text of the date field. When a date field is inserted at a position without a set culture, a TextControl uses the system language to select a culture. Supported formats for a certain language can be obtained through the DateFormField.getSupportedDateFormats method and can be set with the DateFormField.setDateFormat method. When the DateFormat is an empty string, which is the default, the culture's default format is used. A user can also insert or change a date with the keyboard, then the TextControl tries to parse the inserted date depending on the specified format and culture and automatically formats the date. When parsing is not possible the previous date is restored.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Object
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > DateFormField Object
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/llms-full.txt

---

## On This Page

- [Description](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/#description)
- [Syntax](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/#syntax)
- [Examples](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/#examples)
- [Members](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/#members)

---

## In This Section

- [Javascript: DateFormField.getDate Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/getdate-method/llms.txt): Gets the DateFormField's date.
- [Javascript: DateFormField.getDateFormat Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/getdateformat-method/llms.txt): Gets the date's format. For a certain DateFormField the format string should be one of the strings returned through the getSupportedDateFormats function. A TextControl uses Day, Month, Year, and Era Format Picture strings to format a date. When this date's format is an empty string, which is the default value, a default format is used depending on the culture set for the date field's text.
- [Javascript: DateFormField.getEmptyWidth Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/getemptywidth-method/llms.txt): Gets the horizontal extension, in twips, of the date formfield, when it is empty.
- [Javascript: DateFormField.getSupportedDateFormats Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/getsupporteddateformats-method/llms.txt): Gets an array of format picture strings which can be used to format the date. The returned format strings depend on the culture set for the date field's text. A TextControl uses Day, Month, Year, and Era Format Picture strings to format a date.
- [Javascript: DateFormField.setDate Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/setdate-method/llms.txt): Sets the DateFormField's date.
- [Javascript: DateFormField.setDateFormat Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/setdateformat-method/llms.txt): Sets the date's format. For a certain DateFormField the format string should be one of the strings returned through the getSupportedDateFormats function. A TextControl uses Day, Month, Year, and Era Format Picture strings to format a date. When this date's format is an empty string, which is the default value, a default format is used depending on the culture set for the date field's text.
- [Javascript: DateFormField.setEmptyWidth Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/setemptywidth-method/llms.txt): Sets the horizontal extension, in twips, of the date formfield, when it is empty.

---

## Nearby

- **Previous:** [Javascript: CultureSettings.uiCulture Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/culturesettings/uiculture-property/llms.txt)
- **Next:** [Javascript: DateFormField.getDate Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/dateformfield/getdate-method/llms.txt)
