Create Javascript Arrays with Database Values

Posted on 2006-04-27
Medium Priority
Last Modified: 2010-04-06
We have over 1900 employees in our organization and at times it is kind of annoying to go through an entire dropdown to select an employees name from a list. What I would like to do is create 2 dropdowns on the form.

The 1st option - The user would select a section of the alphabet (a-c, d-f, etc)

The 2nd option - Would then contain the users name (retrieved from the database) that begins with the letter selected in the 1st option.

1st - Can this be done in Javascript. I know I can pass option 1 back to the page. But a lot of times my user is just to impatient to wait for it to refresh, therefore I would like to be able to do it with Javascript. I know that I can create two dropdowns where the second value is created based on the first one. But I have never done this with information that is in the database.

Any help would be greatly appreciated.

Thanks in advance
Question by:laevans
1 Comment

Accepted Solution

rockymagee earned 720 total points
ID: 16553437
You will need to create an array of arrays.  The initial selection in your first dropdown will govern which array to load into your second dropdown.  You will populate all of the arrays when the page initially loads with the values from your db.

Here is a link to a short tutorial:


Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question