Title: Combobox editable:false, Select on keypress Post by: edjeasyui on February 05, 2014, 02:12:29 AM Hi all!
Is there any way to select or filter values in an easyui-combobox on key press? I don't want the user to be able to write in the combo cause he is able to write anything maybe not valid (not included in the dropdown list) The functionality that we desire is like simple select element http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select Regards :) Title: Re: Combobox editable:false, Select on keypress Post by: stworthy on February 05, 2014, 03:27:53 AM To prevent from typing anything in textbox, please set 'editable' property to false.
Code: $('#cc').combobox({ Title: Re: Combobox editable:false, Select on keypress Post by: edjeasyui on February 05, 2014, 04:57:19 AM Thanks for the quick answer stworthy.
Although that is not my case. I want to prevent user from writing in textbox but I want him to be able so select values by pressing letters just like the link I provided to my original post (when you click on combo and type "A" then Audi is selected) http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select Do you have a solution for this? To prevent from typing anything in textbox, please set 'editable' property to false. Code: $('#cc').combobox({ Title: Re: Combobox editable:false, Select on keypress Post by: stworthy on February 05, 2014, 08:21:31 AM Please try to add a keydown event hander to the textbox.
Code: var cc = $('#cc'); // the combobox object Title: Re: Combobox editable:false, Select on keypress Post by: edjeasyui on February 05, 2014, 09:28:36 AM Thanks stworthy you are a life saver!
below in my version that loops in values developed as a plugin Code: (function($) { |