Check documentation for the latest version of dhtmlxSuite Input Control DHTMLX Docs

Input Control

an area where the user can type some text:

Adding Input Item

The following syntax shows the user how an Input item can be easily added:

myToolbar.addInput(id, pos, value, width);

This method has the following input parameters:

  • id - id of the new item;
  • pos - position of the new item;
  • value - the text that will be displayed in the input item when it is created;
  • width - width of the new item.

Note: if the user wants the Input item to be created text-free, it's necessary to write an empty string as value parameter. For example:

myToolbar.addInput("input_new",3,"",100);

Related sample:  Input creation

Working with Input Item

The following methods that are available for the Button item, can be applied to the Input Item as well:

Showing/Hiding Input

  • myToolbar.showItem(id);
  • myToolbar.hideItem(id);
  • myToolbar.isVisible(id);

Related sample:  Input manipulation

Enabling/Disabling Input

  • myToolbar.enableItem(id);
  • myToolbar.disableItem(id);
  • myToolbar.isEnabled(id);

Related sample:  Input state

Setting/Getting Input Tooltip

  • myToolbar.setItemToolTip(id, tip);
  • myToolbar.getItemToolTip(id).

Related sample:  Input tooltip

All the parameters of the above mentioned methods are the same as those described in Button Settings Manipulations section.

Setting/Getting Input Value

The following methods that are available for the Slider item, can be applied to the Input Item as well:

  • myToolbar.setValue(id, value); the value parameter is the default text displayed in the Input item
  • myToolbar.getValue(id).

Related sample:  Input value

All the parameters of the above mentioned methods are the same to those described in Slider Settings Manipulations section.

Setting Input Width

There's one more method applied to Select Button that can be applied to the Input Item as well:

  • myToolbar.setWidth(id, width);

Related sample:  Input width

All the parameters of the above mentioned method are the same to those described in Setting Select Button Width section.

Getting Input's Width

The current input's width can be got with the help of getWidth method:

// returns current input's width
var width = myToolbar.getWidth(id);

Related sample:  Input width

Back to top