Last combo is always focused by default

Hello,

In a dhtmlxForm, the last combo is always focused by default if there are options in it.

An example is like this
dhtmlx.com/docs/products/dht … combo.html

Note that the “Bitrate” is always focused by default (after page is loaded).

I don’t think any field should be auto-focused at this point.

Thanks,
Peter

Hello
After init form needs to focus on some input. If you don’t want to focus the combo, you can focus the other item, i.e.:

myform.attachEvent("onXLE", function (){ myform.getInput("project_name").focus() });

Hi Darya,

i want to set focus on submit button, in below code what is onXLE and project_name ?
i need this info so that i can customize below code as per my requirement.

myform.attachEvent(“onXLE”, function (){
myform.getInput(“project_name”).focus()
});

This code needs to be written after initialisation of combobox ?

Thanks

If you have 3.5 version (it was released there), you can do the next:

myform.attachEvent("onXLE", function (){ myform.setItemFocus("button_name") });

Thanks Darya for your quick reply.

I have tried this however its not setting focus on button, below is code snippet.

I am using 8 comboboxes.

var a=dhtmlXComboFromSelect(“ddl1”);
a.enableFilteringMode(true);

var b=dhtmlXComboFromSelect("ddl2");
b.enableFilteringMode(true);
       
var c=dhtmlXComboFromSelect("ddl3");
c.enableFilteringMode(true);
        
var d=dhtmlXComboFromSelect("ddl4");
d.enableFilteringMode(true);

var e=dhtmlXComboFromSelect("ddl5");
e.enableFilteringMode(true);
        
var f=dhtmlXComboFromSelect("ddl6");
f.enableFilteringMode(true);
        
var g=dhtmlXComboFromSelect("ddl7");
g.enableFilteringMode(true);
        
var h=dhtmlXComboFromSelect("ddl8");
h.enableFilteringMode(true);
              
Form1.attachEvent("onXLE", function (){
Form1.setItemFocus("btnSave")});

Form1 is id of my form, please suggest whether i am doing something wrong.

Thanks

I need to ask again just in case: have you version 3.5?

Hi Darya,

I am personally using 3.0, but I recognize it is a bug to auto-focus on a combox after it is initialized.

Will this be fixed in the coming up releases?

Thanks,
Peter

Hi
We’ve added focus to button in 3.5.