Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Posts: 1
Registered: ‎08-03-2011
My Device: Playbook
My Carrier: None

JQuery Autocomplete for the Playbook?

Is there a way to make JQuery's autocomplete feature work for a playbook webworks app? Or another way to get similar result?


Besically I have a list of items, when the user types into the inputbox I'd like a list to show the complete items that begin with what the users typed.


For example, my list has:





when the user types a A, the list will show ABCD and ABCDF, the user should be able to touch either one to autocomplete.



Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified

Re: JQuery Autocomplete for the Playbook?

Yes it is possible to use jQuery autocomplete. You will have to populate an array in Javascript. Include the jquery autocomplete script in your HTML head tag and try the below code.


<!-- HTML code -->
<input type="text" id="itemList" name="list" onclick="loadList();"/>

<!-- Javascript code -->
//Global declaration
var listItems = new Array('ABCD', 'ABCDF', 'BCD');

function loadList() {
	$("#itemList").autocomplete(listItems).setOptions({max: 5});
	 $("#itemList").result(function(e) { 
	    setTimeout( "cancelAutoComplete();",500);

function cancelAutoComplete() {

 loadList function is loading the dropdown on clicking the input field and after selecting an item from the list the cancelAutoComplete is called to hide the dropdown. The script can be used in different ways also. Hope it helps you.