Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Kumar on Apr 04, 2008 08:16
open dhtmlx forum
dhtmlXCombo: Filtering mode: Stop input if no option match found

In a Filtering Mode dhtmlXCombo, stop the user input if no match is found.

For ex., in the below example, if the user types "a0" the option box will present 3 suggestions(a00,a01,a02), but my requirement is if the user types something like "a09" it should stop the user from accepting '9' in 'a09' since it is not a valid option (ending with 9).


<select style='width:200px;' id="combo_zone1" name="alfa1">
<option value="1">a00</option>
<option value="2">a01</option>
<option value="3">a02</option>
<option value="4">a10</option>
<option value="5">a11</option>
</select>
<script>
var z=dhtmlXComboFromSelect("combo_zone1");
z.enableFilteringMode(true);
</script>
Answer posted by Support on Apr 04, 2008 10:31
Current version of dhtmlxcombo doesn't support such behavior, the only way to achieve similar functionality - attach custom code to onKeyPressed event and control typed text manually.
Answer posted by Kumar on Apr 04, 2008 11:02

Thanks for the quick response.

Actually, I found some custom code in the knowledge forum at URL: http://www.dhtmlx.com/docs/products/kb/index.shtml?cat=14&q=2087.

Is there any way I can make use of the limitToList function to achieve this?

If so, after adding this limitToList function to the dhtmlxcombo.js, where exactly should this function be called to achieve the behaviour, let me know.