backspace problem

Hi again!

For example there are 2 words in combo list “Torea” and “Torex”. If i type “Tore” the “Torea” will be selected if i type “Torex” th “Torex” will be selcted, but after it i press backspace(“Torex” -> “Tore”) the “Torex” still be selected insted of “Torea” would be selected.
But i have already sent this question. Thank U!

Rgards, MiB

The problem was not reconstructed locally. We’ve made tests with the latest combo version - attached file. Please, try to use it instead of the original one.
 

dhtmlxcombo.zip (9.11 KB)

I need the value of selected element but neither z._selOption.value; nor z.getSelectedValue(); does work with backspace

Such a behavior is correct. When you delete symbols by backspace, no one value is selected. That is why getSelectedValue returns null.

You can try to use getActualValue, this case the value or current text (if the value is not selected - symbols are deleted by backspace) will be returned:

var value = z.getActualValue();

“this case the value or current text (if the value is not selected - symbols are deleted by backspace) will be returned:” . I would like to make a searcher function like in Firefox when i press F3. I need actual value of element when i press backspace. I have a product list. This is a table. Evry row has a ID. When i type something in combobox i will get back a value. This is the id of row in table, so i can search the row in table. But if i have no value i cant search actual row in table. If it is not clear fot u i would send a demo :slight_smile:

The logic of combo
    getActualValue - returns value selected in combo
       - by click
       - by select and enter
       - by typing new value and moving focus out of combo

    getSelectedValue - returns currently selected value

When you pressing backspace the auto-complete functionality blocked purposely ( because in other case each next backspace will delete auto-completed and preselected part of entered value, not affecting previously typed text ), because after back-space pressed text in input not auto-completed - no any option preselected, and getSelectedValue returns null.

Here is my combojs file i am working now. Here is the z.getSelectedValue() that works almost perfectly. My problem is my first question(“For example…”)

dhtmlXCombo.js.zip (7.29 KB)


The version, which you are using pretty outdated



Please check attached file, I modified code of your version, so now, after backspace it will preselect first options from the list.


dhtmlxcombo_updated.zip (7.23 KB)

Yes, it seems to work perfectly now! :slight_smile:

THANK U VERY MATCH!