Combo question how to get first selection if user left filed

Hello,

I have question about how to make first selection ? The problem is that user can left filed without complete filled, I mean user start write quart and combo suggest him a few quarts, user see them but did not choice one of them like:

User write: alab
Combo suggest: Alabama 1, Alabama 2

User left field with tab or click elsewhere on page. With this action user will be misguided that he think first choice will be selected, but actually not.

Here is my script first:

      var myCombo;
      var myQuart;
      function doOnLoad() {
         
         myCombo = new dhtmlXCombo("city", "city", 350);
         myCombo.setTemplate({
            input:  "#word#",
            columns: [
               {header: "Town", width: 100},
               {header: "PO CODE", width: 50},
               {header: "Department", width: 100},
               {header: "Department 2", width: 100},
            ]
         });
         myCombo.enableFilteringMode(true, "loadCity.php", true, true);
         myQuart = new dhtmlXCombo("quart", "quart", 350);
         myQuart.setTemplate({
            input:  "#word#",
            columns: [
               {header: "Type", width: 50},
               {header: "QuartName", width: 300},
            ]
         });
         myQuart.enableFilteringMode(true);
         myCombo.attachEvent("onChange", function(value){
         myQuart.clearAll();
         myQuart.setComboValue(null);
         myQuart.setComboText("");
         var citys = value.split(',');
         var cityid = citys[0];
         if (cityid == null) {
            myQuart.disable();
         } else {
            myQuart.enable();
            myQuart.enableFilteringMode(true, "loadQuart.php?mask2="+cityid, true, true)
         }
         });
      }
   </script>

Hi

you can add onBlur event to combo, and check if value selecetd ibn a combo. if show - show popup or dhtmlx message.

myCombo.attachEvent("onBlur", function(){ if (myCombo.getSelectedValue() == null) { // value not selected } });

Ah very interesting thing that I see. The see input city when I write name of the town, first town is selected auto and then when user continue writing town name, combo automatic appended town name, but that does not happened on filed quart. OnBlur event I doubt to work correct in my case because the quart also can be a new and is not necessary something to be selected, but if something is selected even wrong user can make changes on what he write. Is there a way second and third input value also to work as I want ? Sorry my english isnt so good.