tags:

views:

434

answers:

1

I have a list box control that contains enough items to list them with a scroll bar.

I'd like the user to be able to enter a few letters and have the ASP ListBox scroll to the first option whose text starts with those letters.

I'm hoping that JQuery offers some simple functionality or plug-in that works with the element, but so far, I've only seen plug-ins that work with scrolling DIVs.

Is there a way to scroll an ASP ListBox to a specified option?

EDIT

As @Alex Sexton stated, you can just select the option via javascript and it will scroll there automatically. Here is some simple JQuery to do just that:

$('#ListBox option:eq(6)').attr('selected', 'selected');
+2  A: 

Your browser should handle the scroll automatically upon setting the selected attribute to "selected" on the element that you wish to put into view.

Alex Sexton
Holy wow, I'm starting to feel very stupid... Let me check this out...
Michael La Voie