LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-07-2004, 03:20 AM   #1
lothario
Member
 
Registered: Apr 2004
Posts: 340

Rep: Reputation: 30
Need JavaScript help with Listbox


I have a dropdown listbox called "list1".
It is a single select listbox.
It is a required field on the page.
It contains a list of items sorted in alphabetical order.
This list is loaded from a database table.
This list is updated daily.
This list will always contain a min of 80 and max of 120 items.

The users do not like to scroll thru so many items to find the 1 item they need.
The main reasons are that the vertical scrolling is a pain and
there are many other fields on the screen so speed is important.

To find the items that begin with "B" they have to click on the listbox
and then click on the "B" key. This scrolls down to the first item
beginning with "B". But this involved the mouse and keyboard.
And mouse again if they want to scroll further into the list of B's.

To speed this up we want to eliminate the keyboard.
Here is how:

1. Keep the listbox as is.
2. Put a row of radio buttons above the listbox.
3. The radio buttons are labeled "A", "B", ... "Z"
4. When the user clicks on the "B" radio button, the
JavaScript automatically scrolls the listbox to
the first item beginning with "B".
5. Then the user can do more scrolling if needed.


I am not a JavaScript expert.
Can you help me with a JavaScript that:
a. I can add to the onclick of the radiobuttons.
b. It grabs the label of the selected radiobutton.
c. Scrolls vertically to the first occurence of
the matching item in the listbox.


Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript help darin3200 General 4 09-03-2005 11:58 PM
Putting a timestamp on a listbox item (vb.net) mrobertson Programming 8 08-01-2005 12:23 PM
Javascript maseby Programming 1 04-09-2004 05:16 PM
javascript in <td>? akaash Programming 0 03-18-2004 12:22 AM
Help with javascript? BajaNick Linux - Software 2 07-20-2003 08:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration