473,661 Members | 2,432 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically Fill List Box

101 New Member
Hi,

I have three Listbox on my jsp page.

I want to do following:

ByDefault first list will be filled by database, When User select something from 1st list box second will fill accordingly by database using Ajax.

When user select something from 2nd list third will get data.


Please help in this how to do this.....I don't want to refresh whole page


Regards,
Dec 16 '07 #1
5 11281
acoder
16,027 Recognized Expert Moderator MVP
I have three Listbox on my jsp page.

I want to do following:

ByDefault first list will be filled by database, When User select something from 1st list box second will fill accordingly by database using Ajax.

When user select something from 2nd list third will get data.
What code have you got so far? Get your server-side script to return the options, parse the response to append them to the second list, or just return some HTML and set the innerHTML.
Dec 17 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
http://www.quirksmode.org/js/options.html
That's a non-Ajax solution, but an alternative nonetheless.
Dec 17 '07 #4
buntyindia
101 New Member
That's a non-Ajax solution, but an alternative nonetheless.
Hi Mod,

Thanks for the reply :)

I have created the ajax solution...now one more problem i am facing....in IE
in Mozilla everything working Fine.

First List I am generating by default on the page load time by the database...
To fill the second list I am Storing the Selected Item of first list inside a variable then I am creating a URL (example: /Query.jsp?selec tedOption="Some thing")
and passing this using ajax to controller to fetch the data from database.

Till stage it is working fine in both browsers...
But when I select something in Second List to generate the third list in URL the value for selectedOption i am getting blank in IE(example: /Query.jsp?selec tedOption=) in Mozilla i am getting the value correctly...


Why it is not getting the value inside IE...please help....
In view source code i notable to see the code of lists boxex that are generated on the fly using the Javascript...


Please help
Dec 19 '07 #5
acoder
16,027 Recognized Expert Moderator MVP
But when I select something in Second List to generate the third list in URL the value for selectedOption i am getting blank in IE(example: /Query.jsp?selec tedOption=) in Mozilla i am getting the value correctly...
Can you show the code for this part?
Dec 20 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1596
by: RelaxoRy | last post by:
I have 3 texfield boxes 1. firstname 2. lastname 3. username When a person enters in their firstname and lastname, I want the username field to fill with firstnameLastinitial. Eg. Firstname = Adam, Lastname = Apple, Username = AdamA
3
12045
by: ali poursadri | last post by:
Hi, I want to fill my list box from a dataset in c#. I use adapter and fill command and bind it to a listbox, but it is very slow for large data about 500000 records. How can I view this list rapid? thanks.
1
2171
by: Zameer Syed | last post by:
I have a webform in which users enter their information and there is a button at the end of form,which when clicked should open a word document with fields filled in dynamically with the information the user enters in the webform.I hope you understand what i mean.I am trying to do that.Could you please suggest how i could do that. Thanks, Zameer
3
2658
by: Stefan Richter | last post by:
I would like to fill a Selectbox dynamically. I am taking all values from a db, and fill them into a selectbox. I guess the best way was to use some kind of a dynamical array, where you don't have to say how many elements it will contain. In Java there exists special containers to achieve that, but what about VB? I thought about somethign like that: select year from db
3
2101
by: Advertis | last post by:
Is there a way to populate a dropdown in a GridView with the next x years? I am using a GridView to display data from a SQL table One of the fields is a Year. I want to have the dropdown list not only the year in the db field, but also the current year to the next x years. Any ideas?
1
1832
by: Petyr David | last post by:
Current: web page has hard coded directories (using checkboxes) user may choose to search for files matching a pattern they enter in text box. Perl is used to search for files and to format HTML output. Desired: dynamically created group of checkboxes upon opening web page. My initial idea is to have user run separate Perl script to find
4
1849
by: blg002 | last post by:
All I am trying to do is dynamically fill the "Your Price" field with a number that is the product of the value of "acres" "regularity" and 10. The annoying part is I had it working yesterday and can't figure out what I did to break it. Link.. http://www.gdarb.com/jj/estimate.html Javascript... function autofill() { document.estimate.price.value = "$" + document.estimate.acres.value * document.estimate.regularity.value * 10 + " per...
2
1944
by: physicslad | last post by:
Hi, I have in my program a list of lists of variables. These variables change as the program runs. I would like to be able to link meaningful names to the variables. So, say I have a list of quantities of different coins in my possession myChange = where the entries are the quantities of pennies, nickels, dimes, and quarters I have, respectively. Can I assign variable names to the entries so that if, in the course of my...
0
1054
by: sravan_reddy001 | last post by:
I am developing a e-news website.. i bought space from websuvidha.org.. they are also providing some emails... http://mail.asianmedianetworkinc.com/ http://216.157.131.123/index.php the above are the links for the mail server.. now i have the details of each account that can login to my website..
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8754
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8542
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7362
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1740
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.