fields.label
Label to display for the field input.
Please note - this property requires the Editor extension for DataTables.
Description
The field label is the primary piece of information that tells the end user what the data in the field they are entering represents. This is normally as simple as a one or two word string, but can be arbitrarily complex as your form demands. Because of its importance, it is vital that the label be both relevant and concise. This option provides the option of setting the label for a field.
Although this field is not required, it is very much a recommended parameter for non-hidden fields. Otherwise, the end user won't know what information they are being asked for in a field!
The field label can be retrieved and set using the field().label() API method after the field has been initialised.
Type
This option can be given in the following type(s):
Example
:
var editor = new DataTable.Editor({
ajax: 'php/staff.php',
table: '#myTable',
fields: [
{
label: 'First name:',
name: 'first_name'
}
]
});