• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Help ...Dynamic Drop Down list

 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Eric ,
You have solved my problem
Hemant
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad to help
 
That new kid is a freak. Show him this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic