473,467 Members | 1,603 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

combo box with ajax

jairajsingh
2 New Member
how we can change value of one combobox onchange in another combobox using javascript
May 13 '10 #1
2 2107
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
Wrong forum :)

Regards
Dheeraj Joshi
May 13 '10 #2
jkmyoung
2,057 Recognized Expert Top Contributor
Master Slave comboboxes.
1. set up the secondary options in a group
group[0][0] = new Option("some option", 14)
group[0][1] = new Option("another option" 23)
group[1][0] = new Option("next set", 32)
group[1][1] = new Option("more options", 22)

2. Tie the first combobox to a onchange event eg:
<select name="Area" size="1" onChange="redirect(this.options.selectedIndex)">

3. Make the onchange event change the second combobox. (named temp in this example)
Expand|Select|Wrap|Line Numbers
  1.             function redirect(x){
  2.  // delete previous options.
  3.             for (m=temp.options.length-1;m>=0;m--){
  4.               temp.options[m]=null;
  5.             }
  6.  
  7. // set new options
  8.             for (i=0;i&lt;group[x].length;i++){
  9.                temp.options[i]=new Option(group[x][i].text,group[x][i].value)
  10.             }
  11. //set first one by default.
  12.           temp.options[0].selected=true
  13.           }
  14.  
Common request.
May 13 '10 #3

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

Similar topics

4
by: Doug | last post by:
Hi, Does anybody have a good deal of knowledge in AJAX? I am trying to learn this new stuff but cannot find a good place to start. Even when i search for that term in Google. As far as I know,...
3
by: Raghavendra Reddy | last post by:
How to bind combo boxs from database using Ajax.Any body help me regarding this.(With out page refresh) Example criteria: Based on country combo box populate STATE combobox & Based on STATE combo...
8
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I'm about to finally make the jump and start a new site using AJAX. THe question i have for all of you AJAX developers out there is which one? 1. The Standard AJAX frame work 2. The Tool kit....
1
by: shivendravikramsingh | last post by:
hello friends, actually i have a problem in using conditional statement in ajax function i m tring to describe my problem properly,what i want when i select a value form a combo its vlue is passed...
7
by: RaefKandeel | last post by:
Hi all, this is my first post. I have a little ajax assignment that works fine on mozilla firefox 2.0, but doesn't work at all on Internet Explorer 7. Apparently it has to do with the line where...
1
by: aswath | last post by:
hi dere, i'm new to ajax.. i did a small example using it successfully.. but the problem i'm facing is, how to display the data in a combo box.. if i know the no.of values that is coming from db i...
7
by: SV | last post by:
I am using ASP.Net / VB.Net v 2005. I want to add text recognition to one of the text box of suburb in my form. What I want to do is when user type any character in that text box, one dynamic list...
9
by: =?Utf-8?B?RGFuaWVs?= | last post by:
Hi, I downloaded the sample application that the Microsoft video ASPNETAJAXForWinMobile described but it doesn't work on my Windows Mobile 6 emulator. After enabling the script error reporting...
3
by: mukeshrasm | last post by:
Hi I am creating a website to find car of different make and model.for that i am using two combo box one for car make and other for car model. when user clicks car make combo box and selects say...
1
by: kumaran1982 | last post by:
Hi All, I have tried many ways but I can't add the item to dojo combo box dynamically. There are two combobox in my jsp, One is continent values another is country values, On changing the...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.