hidden

Since: Editor 1.0

Hidden field.
Please note - this property requires the Editor extension for DataTables.

Description

A hidden input that cannot be seen, nor modified by the end user. Unlike all of the other built in field types in Editor, this field is not displayed in the form at all, and does not have any DOM representation. Its value is held in Javascript only.

Note that this does not use <input type="hidden"> - if you wish to set the value of this field use the val() or field().val() API methods.

Options

This field type does not support any additional options over the default options.

Methods

This field type does not support any additional methods over the default methods.

Examples

Basic initialisation:

editor.add({
	type: 'hidden',
	name: 'sid',
	def: '1234567890'
});

Include a hidden timer field - setting the value each second:

var counter = 1;

editor.add({
	type: 'hidden',
	name: 'timer',
	def: 0
});

var timer = 0;
var interval;

editor
	.on('open', function () {
		timer = 0;

		interval = setInterval(function () {
			editor.field('timer').val(timer);
			timer++;
		}, 1000);
	})
	.on('preSubmit', function () {
		clearInterval(interval);
	});