Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by MiB on May 08, 2008 09:40
open dhtmlx forum
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
Answer posted by Support on May 12, 2008 07:37
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.
 
Attachments (1)
Answer posted by MiB on May 13, 2008 05:23
I need the value of selected element but neither z._selOption.value; nor z.getSelectedValue(); does work with backspace
Answer posted by Support on May 13, 2008 09:43
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();
Answer posted on May 13, 2008 17:03
"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 :)
Answer posted by Support on May 14, 2008 08:23
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.

Answer posted by MiB on May 14, 2008 12:14
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...")
Attachments (1)
Answer posted by Support on May 15, 2008 05:34

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.

Attachments (1)
Answer posted by MiB on May 15, 2008 06:08
Yes, it seems to work perfectly now! :)

THANK U VERY MATCH!