fields.submit
Define if the field's value should be included in the submitted data.
Please note - this property requires the Editor extension for DataTables.
Description
It can sometimes be useful to have a field on screen which is for information purposes only, providing context for the end user in the form or just simply to split the form up (the built in readonly and the plug-in display field types are common examples of where this is useful). On those cases you might not wish to have the data submitted to the server from these fields (it is optional, as sometimes it can be useful!).
The fields.submit option can be used to control if a field's value should be submitted to the server or not. By default it will be, but seeing this option to false will stop the field being submitted.
Type
This option can be given in the following type(s):
Example
Don't submit a specific field:
var editor = new DataTable.Editor({
ajax: '/api/staff',
table: '#myTable',
fields: [
{
label: 'Name:',
name: 'name'
},
{
label: 'Created:',
name: 'created',
type: 'readonly',
submit: false, // Value shown for information only. Server will create a real time stamp
def: function () {
return new Date().toISOString();
}
}
]
});Related
The following options are directly related and may also be useful in your application development.