field().labelInfo()

Since: Editor 1.6

Get / set label information for the field.
Please note - this property requires the Editor extension for DataTables.

Description

A short description explaining a field can often be beneficial to let users know what a field is used for, and thus what data is expected from them. This method can be used to get / set a field's label information (which is shown directly under the label itself - fields.label / field().label()).

Label information can be set when it is initially added to the form using the fields.labelInfo option. This API method extends that ability by providing a method to get and set the field information message any point after a field has been added to the form.

Editor provides three different elements for information display in each field, which can be used independently of each other, or in conjunction as required by your user interface design:

Types

field(…).labelInfo()

Since: 1.6

Get the current label information text for the field

Returns:

string: Current value

field(…).labelInfo( info )

Set the label information text for the field

Parameters:

Returns:

DataTable.Editor.Field: Field instance

Examples

Show a description string explaining what a field does.:

editor
	.field('user')
	.labelInfo('The user name is what the system user will login with');

Clear an information message:

editor.field('user').labelInfo('');

Related

The following options are directly related and may also be useful in your application development.