field().name()
Get a field's configured name.
Please note - this property requires the Editor extension for DataTables.
Description
The field name is used as the variable name to send data for the field to the server. It is typically a human understandable, albeit concise, description of what data is contained in the field (for example first_name, or account_type).
The field name is set when it is initially added to the form using the fields.name option or the name option of the field-options object given to add() when dynamically creating a field. This API method provides a method to get the name of the field after it has been created.
There is no API method to change the name of a field. If you require to do that, use the clear() and add() methods to remove the existing field and then add a new one to the form.
Type
field(…).name()
Get the field's name
Returns:
string: The field's name that was configured when the field was created.