JavaScript to enhance value prompt's functionality

Cognos Experts,
I have a need to provide "Type Ahead" functionality on a value prompt. I have value prompt with "List Box" UI. Prompt values are populated based on database table. Normally a user would scroll thru the list of available values and select the ones needed.

Does anyone know how I could add a Type Ahead box next to the prompt such that as I start typing values in this box, the List Box prompt highlights the closest value so users don't have to scroll thru the list.

I'm guessing it'd be along the lines of adding a HTML item. Could someone provide the code needed to provide this functionality and enhance prompt behavior.

Will do. Cognos sometimes misses the bus on simple functionality that most web-applications provide. I'm sure the javascript method will work to get me past this requirement, but I'll go ahead and submit an enhancement request for IBM to include this out-of-box in future Cognos 10 releases..

@Swetal - The type ahead feature doesn't stop with the first letter, I just created a report in ReportStudio 8.4.1 and tested it with a list of retailers, I was able to successfully type "Amazon" and go to the corresponding entry. I tested this both on Firefox 4 and IE 8.

Nevertheless, here is a javascript that would do it using a text box as you wanted. I used a table to place my items.

************ This script works in firefox only. *************

1. Create an HTML item before the value prompt and put the following script in it:

<input type="text" name="type_ahead" onkeyup="selectMerchant()">

2. In the next row, place your value prompt

3. In the third row, create another HTML item and put the following script in it: