Is it possible to add any of the keyboard event handler for the toolbar’s text object. I’d like to enable a button on the toolbar, but only when something is entered into a text object.
Here is your approach
Script:function doOnLoad() {
toolbar = new dhtmlXToolbarObject("parentId");
toolbar.setIconsPath('../dhtmlxToolbar/codebase/images/');
toolbar.addButton('logo','0',"Button");
toolbar.disableItem('logo')
}
function f2(){
toolbar.enableItem('logo')
}
Body:<div id="parentId" style="height: 50px; width: 400px"></div>
<input type="text" id="inp" onkeyup="f2()" style="width: 200px; margin: 150px; background-color: #fafad2;">
Darya,
No…no…I need to add the handler to the toolbars text input object. I am creating the object with this: docs.dhtmlx.com/doku.php?id=dhtm … t_addinput
toddaa, have you downloaded new 3.5 version of DHTMLX Suite?
There is a toolbar.getInput(id) method.
You can use it with the next approah:
toolbar = new dhtmlXToolbarObject("parentId");
toolbar.setIconsPath('../dhtmlxToolbar/codebase/images/');
toolbar.addButton('logo','0',"Button");
toolbar.addInput('inptlb', 1, '', 200);
toolbar.disableItem('logo');
obj = toolbar.getInput('inptlb')
obj.onkeyup = function(){
toolbar.enableItem('logo')
}
Darya,
Yes, Thanks! Exactly what I was looking for.
You are welcome!