473,320 Members | 1,744 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

dependent Combo box in AJAX

hi,i would like to know how to fill a combobox2 in struts2 using AJAX depending on a particular value in the combobox1.Only the combobox2 should get refreshed everytime.please help at the earliest.Thank you.
Feb 1 '08 #1
3 5104
hi,i would like to know how to fill a combobox2 in struts2 using AJAX depending on a particular value in the combobox1.Only the combobox2 should get refreshed everytime.please help at the earliest.Thank you.
If I have a problem like this (where a lot of people get the same problem), I usualy go to http://javascript.internet.com. On this site I get the scripts that are allready programmed. They can even send you the scripts by e-mail etc. Here's a link to the pages I would suggest according to your query: http://javascript.internet.com/navig...-comboxes.html, http://javascript.internet.com/navig...pdown-box.html. The script needs to be retyped in order to work if a change has been made.
Feb 2 '08 #2
acoder
16,027 Expert Mod 8TB
hi,i would like to know how to fill a combobox2 in struts2 using AJAX depending on a particular value in the combobox1.Only the combobox2 should get refreshed everytime.please help at the earliest.Thank you.
If you want to use Ajax for this, trigger your Ajax request function in the onchange event handler for the first combobox. The Ajax function should make a request to a server-side script which returns the options, either as an HTML snippet which you just set to combobox2 or as XML or JSON which you will need to parse.
Feb 3 '08 #3
acoder
16,027 Expert Mod 8TB
If I have a problem like this (where a lot of people get the same problem), I usualy go to http://javascript.internet.com. On this site I get the scripts that are allready programmed. They can even send you the scripts by e-mail etc. Here's a link to the pages I would suggest according to your query: http://javascript.internet.com/navig...-comboxes.html, http://javascript.internet.com/navig...pdown-box.html. The script needs to be retyped in order to work if a change has been made.
Those links don't use Ajax. All the data is already stored within JavaScript arrays. That is an alternative way - it's not always necessary to use Ajax for every task.

Just a note on using ready-made scripts. Some are not really up-to-scratch. Check the date and look for browser detection. Some are too old and not up to date.
Feb 3 '08 #4

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

Similar topics

10
by: lorirobn | last post by:
Hi, I have a form with several combo boxes, continuous form format, with record source a query off an Item Table. The fields are Category, Subcategory, and Color. I am displaying descriptions,...
4
by: Miguel | last post by:
I have an order entry database with two forms. One is for new orders the other is to update orders. The forms are identical except that one is strictly order entry. On both forms are three sets of...
0
by: annivanova | last post by:
Hi, I saw posts in Dependent listboxes on access forms, which problem is very similar to my. I’m from Bulgaria and working over to create an MS Access application. I used in my project given code...
8
by: Cerian | last post by:
Hi there, I'm having trouble getting my 3rd dependent combo box to work in Access 2003. I have three dependent boxes named cbogroup, cbosection and cbofunction. Each one is dependent on the...
1
by: monikagovindaraj | last post by:
how to fill the dependent combo box using ajax
4
by: shreyansghia | last post by:
Hello , I ve a form which is based on a table viz SalesOrder. 1 of the field which Sales Order has is : Client. I ve 2 more tables, (a) Client which has 1 field viz ClientName , (b)...
4
by: deanndra | last post by:
First, I want to say thank you to Scott and the others who replied to my first post here. I had to put that database on hold for the moment when I was tasked with a new one. I am building another...
1
by: avigiano | last post by:
Good morning. I have a contacts database that tracks the regular things like phone numbers, address etc. User searches for contacts through a combo box that lists entires by last name. I've...
1
by: sbettadpur | last post by:
Hi, Iam completely new to ajax, I have a task which is 3 dependent dropdowns which are generates automatically from three deferent databases tables based on one another table. example 1.country...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.