---
title: Field component (Deprecated)
slug: '1114'
canonical_url: https://docs.coveo.com/en/1114/
collection: coveo-for-salesforce
source_format: adoc
---
# Field component (Deprecated)
> **Deprecated**
>
> This feature is still available, but no longer supported as of the April 2020 release of Coveo for Salesforce version [4.2](https://docs.coveo.com/en/3236#april-2020-release-v4-2-initial-release).
This component adds a text input to a case creation form.
## Options
### `title`
Specifies the title to display above the input.
```xml
```
Where you replace `` by the title you want for your text input.
### `caseField`
Specifies the field used to save the input value when the user submits the form.
```xml
```
Where you replace `` by the name of the field you want to use.
### `numberOfLines`
Specifies the input height in number of lines.
The default value is `1`.
```xml
```
### `placeholder`
Specifies a short hint displayed inside the input before the user enters a value.
```html
```
Where you replace `` by the hint message you want to display in the input.
### `tooltip`
Specifies what to display when the user's mouse is over the `title`.
```xml
```
Where you replace `` by the message you want to display when the user's mouse is over the `title`.
### `isRequired`
Specifies whether the input has to be filled before the form can be submitted.
The default value is `true`.
```xml
```
### `enableSearch`
Specifies whether to include the entered keywords in the search for related cases.
The default value is `true`.
> **Important**
>
> If `addQre`, `addSome`, and `addCorrelateUsingIdf` are all set to `false`, `useSomeOnAllKeywords` on the [CaseCreation component](https://docs.coveo.com/en/1071/) needs to be enabled for this option to be useful.
```xml
```
### `enableAnalytic`
Specifies whether to enable analytics on the component.
The default value is `true`.
```xml
```
## Methods
### `searchIsValid`
Returns `true` if search is enabled and the value isn't empty.
```javascript
$('#myField').coveo('searchIsValid')
```
### `setValid`
Marks the field as valid.
```javascript
$('#myField').coveo('setValid')
```
### `setInvalid`
Marks the field as invalid, preventing the user from creating a case using the `submit` button.
The field becomes valid if the field changes, the `cancel` button is clicked, or the `setValid` method is called.
```javascript
$('#myField').coveo('setInvalid')
```
### `getValue`
Gets the value of the input.
```javascript
$('#myField').coveo('getValue')
```
### `getCaseField`
Gets the value of the `caseField` option.
```javascript
$('#myField').coveo('getCaseField')
```
### `setValue`
Sets the value of the input, with the following properties:
* `value`: The value to set.
* `triggerChange`: (Optional) Whether to trigger a query.
The default value is `true`.
```javascript
$('#myField').coveo('setValue', 'valueToSet', 'true')
```
## Usage
```xml
```