aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Replacing Entire Select Box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Replacing Entire Select Box" Watch "Replacing Entire Select Box" New topic
Author

Replacing Entire Select Box

A.S. HariLal
Ranch Hand

Joined: Oct 24, 2007
Posts: 31
Dear Friends,
I have a problem with the select box. There are 3 radio buttons and two combo box(select boxes). According to the radio button selected I have to display some static datas on first combo and some dynamic datas(loaded from data base)on the second combo. If any one have a solution please help me, Thanks in Advance
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Fill the static data into select box isn't a big deal.. a little search on google will give you more and more example..

for the next select box, you haven't tell us whether what technology or technique you're use for getting the data from the database.


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
A.S. HariLal
Ranch Hand

Joined: Oct 24, 2007
Posts: 31
Dear Friend,
I am working with struts frame work. In the beginning I store the values to a ArrayList and that to be shown in the combo/select box.
For example, there are two array lists one for storing Teachers Name and other for students. By selecting the radio button "Student" Dynamic select box will be filled with Student Name(Which I Stored to a Arraylist in the beginning)and similarly by selecting the radio Teacher the select box will be filled with Teachers name. On the otherhand the ststic select box is for selecting the age range. I hope now you can understand what the idea is.....Hope solutions...........Thanks in advance
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

If you have all the data you need when the JSP is executing, then you can create JavaScript data structures to hold that data for later use in populating the dynamic select element. If not, you'll need to make an Ajax call in order to fetch that data (JSON would be a good data exchange format for this).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

This might help you to step forward...
A.S. HariLal
Ranch Hand

Joined: Oct 24, 2007
Posts: 31
Dear Friends,
If there is a example please post here, I hope it will be more helpful for me.......Thanks in advance
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

Originally posted by A.S. HariLal:
If there is a example please post here
There are examples all over the web. Please show some effort.
A.S. HariLal
Ranch Hand

Joined: Oct 24, 2007
Posts: 31
Dear Friends,
Thanks for your valuable suggestion, I got the logic and hope it can be successfully implement......Once again thanks for all...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Replacing Entire Select Box