File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help ...Dynamic Drop Down list

 
himanshu patel
Ranch Hand
Posts: 205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Eric ,
You have solved my problem
Hemant
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad to help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic