Combo not working with first enter, blanking out not working

Two issues, shown in this video (note, both are used in remote-xml mode):

  1. When typing in the combo, the first entry is selected (blue), so if the user hits enter, it does not select the selected one. So either we need to not have one selected by default, or have enter select the selected one (ideal).

  2. In certain circumstances, when an item is selected, then cleared out, the label gets cleared, but not the value. so on the server side, it thinks the user selected an item, but instead, blank should be sent.

youtube.com/watch?v=748MgQtlD8Q

Thanks!
Chris

Probably you are not using the latest version. Here is the sample with autocomplete:

dhtmlx.com/docs/products/dht … ilter.html

So either we need to not have one selected by default, or have enter select the selected one (ideal).

In order to select the first option on enter key press you can try to use the following:

combo.attachEvent("onKeyPressed",function(key){ if(key==13){ if(this.getOptionByIndex(0)) this.selectOption(0); } });

However, there is no need to use this approach if you are using the latest version.

it thinks the user selected an item, but instead, blank should be sent.

Try to call confirmValue() onsubmit
combo.confirmValue();

Here is the sample
dhtmlx.com/docs/products/dht … _save.html

Hi,

thanks - with V4.4 it works fine.

It seems like it was for this topic?
viewtopic.php?f=4&t=49139&p=135596#p135596
Anyway you are welcome! :slight_smile: