| Author |
Help ...Dynamic Drop Down list
|
himanshu patel
Ranch Hand
Joined: Feb 03, 2003
Posts: 205
|
|
Please suggest me some solution for my problem, I have created one web application using HTML and JavaScript in which I have one drop down list. The initial values in this drop down list is populated from database through function using JSP when first time page loads. In addition, my HTML page is having alphabet list from A….Z. Clicking on any alphabet should display only those values in this drop down list, whose first latter starts with clicked alphabet. For example, If I click on alphabet “B” than, I want show only those values in drop down list, whose first latter starts with “B” and so on. I am doing this through JavaScript. Now the problem is that first time it works fine. But next time when I click on any other alphabet, It does not. Reason being, now drop down list contains only those values, which are result of previous alphabet click action. I must need original drop down list throughout. To get rid of this, I need to store initial values somewhere. But I do not know how? Could any one suggest any idea how could I tackle this problem? Thanks in advance.
|
If you want to become a rich, do not work for others but make others to work for you.
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
You are going to have to do it with an array and get the letters of the alphabet from that array and then populate it. Look at http://www.dynamicdrive.com to show you how to populate a select from an array with their combo boxes. Eric
|
 |
himanshu patel
Ranch Hand
Joined: Feb 03, 2003
Posts: 205
|
|
Thanks a lot Eric , You have solved my problem Hemant
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
|
Glad to help
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: Help ...Dynamic Drop Down list
|
|
|