• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Adding Values on runtime

 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all i have following view of my jsp page
|------------------| |------------------|
|combo Box 1 V| |combo Box 2 V |
|------------------| |------------------|
For populating both comoboxes i have two querys
i m filling combox1 when i load my page
but combox2 is to be filled after value selection
from one cause that valueis used in query for next combobox!! this is to be done with out refreshing the form , i cant use jsp code for it!
so is there any way to do it using javascript ???
I know i will have to get values for all id in combox1 which r to be filled on cb2 but i m not getting how to do this onchage event !!
kindly help me out
thanx in advance !!!
 
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Praful,
if the order ( index ) of selectbox-options is equal, you can use selectedIndex:

hth
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, you can do it with JavaScript, it is called a double combo
Here is a list of scripts that may help
http://www.javascriptkit.com/script/cutindex16.shtml
Eric
 
It's exactly the same and completely different as this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic