User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 397,800 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,367 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 6791 | Replies: 3 | Solved
Reply
Join Date: Oct 2006
Location: Karachi,Pakistan
Posts: 27
Reputation: irfan.motiwala is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
irfan.motiwala's Avatar
irfan.motiwala irfan.motiwala is offline Offline
Light Poster

Multiple COmbo Box

  #1  
Oct 13th, 2006
i have page contain two combo box




USA UK GERMANY



i want that if i select usa then 2nd combo box will shows only cities of usa plz provide me help
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Multiple COmbo Box

  #2  
Oct 13th, 2006
There is no such thing as a combobox in HTML. Are you posting in the correct forum?
Reply With Quote  
Join Date: Jun 2004
Location: Hemet, CA
Posts: 427
Reputation: FC Jamison is on a distinguished road 
Rep Power: 5
Solved Threads: 17
Colleague
FC Jamison's Avatar
FC Jamison FC Jamison is offline Offline
Posting Pro in Training

Re: Multiple COmbo Box

  #3  
Oct 16th, 2006
Do you mean a dropdown form field?
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 1,289
Reputation: vishesh is on a distinguished road 
Rep Power: 4
Solved Threads: 32
vishesh's Avatar
vishesh vishesh is offline Offline
Nearly a Posting Virtuoso

Re: Multiple COmbo Box

  #4  
Oct 17th, 2006
i think u mean to say that drop down form field, i think you are from a software developer, we call that drop down. you will have to use javascript. i am not particularly giving you example for that us cities and all but its a simple example which i had mad quite few times back:
<html>
<head>
<!-- ####################### start copying the HEAD code(DMA) here ####################### -->
<script language="javascript">
<!--//
//new Option("text","value")
//this code changes menus
function nullOptionsDMA(aMenu){
var tot=aMenu.options.length
for (i=0;i<tot;i++)
{
aMenu.options[i]=null
}
aMenu.options.length=0;
}
function MySubjectDMA0(aMenu){
nullOptionsDMA(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("Select a page","none");
options[1]=new Option("1","1.htm");
options[2]=new Option("2","2.htm");
options[3]=new Option("3","3.htm");
options[4]=new Option("4","4.htm");
options[0].selected=true
}
}
function MySubjectDMA1(aMenu){
nullOptionsDMA(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("5","none");
options[1]=new Option("6","6.htm");
options[2]=new Option("7","6.htm");
options[3]=new Option("8","7.htm");
options[4]=new Option("9","8.htm");
options[5]=new Option("10","9.htm");
options[0].selected=true
}
}

function MySubjectDMA2(aMenu){
nullOptionsDMA(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("11","none");
options[1]=new Option("12","12.htm");
options[2]=new Option("13","13.htm");
options[3]=new Option("14","14.htm");
options[0].selected=true
}
}
function MySubjectDMA3(aMenu){
nullOptionsDMA(aMenu)
with (aMenu){
//Rewrites the text and values

options[0]=new Option("15","none");
options[1]=new Option("16","16.htm");
options[2]=new Option("17","17.htm");
options[3]=new Option("18","18.htm");
options[0].selected=true
}
}
/* ####################### goDM() ####################### */

function goDMA(aMenu){
if (aMenu.options.value!="none")
{
location=aMenu.options[aMenu.selectedIndex].value
} 
}
/* ####################### setUp ####################### */

function setUpDMA(){
with (document.formDoubleMenuDMA) {
if (menuSubjectsDMA.selectedIndex==0){
menuSubjectsDMA.options[0].selected=true
menuFilesDMA.options[0].selected=true
}

if (menuSubjectsDMA.selectedIndex==1)
MySubjectDMA0(menuFilesDMA)
if (menuSubjectsDMA.selectedIndex==2)
MySubjectDMA1(menuFilesDMA)
if (menuSubjectsDMA.selectedIndex==3)
MySubjectDMA2(menuFilesDMA)
if (menuSubjectsDMA.selectedIndex==4)
MySubjectDMA3(menuFilesDMA)
}
}
/* ####################### changeFiles ####################### */
function changeFilesDMA(){
aMenu=document.formDoubleMenuDMA.menuSubjectsDMA
aMenu2=document.formDoubleMenuDMA.menuFilesDMA
with (aMenu){
switch (selectedIndex) {
case 0:
aMenu2.options.length=0;
aMenu2.options[0]=
new Option("Pages appear here","none")
aMenu2.options[0].selected=true;
history.go(0)
break 
case 1: 
MySubjectDMA0(aMenu2) 
aMenu2.options[0].text="1-4"
break 
case 2: 
MySubjectDMA1(aMenu2) 
aMenu2.options[0].text="5-10"
break 
case 3: 
MySubjectDMA2(aMenu2) 
aMenu2.options[0].text="11-14"
break 
case 4: 
MySubjectDMA3(aMenu2) 
aMenu2.options[0].text="15-18"
break 
}
}
}
//-->
</script>
<!-- ####################### end copying code (DMA) from the HEAD ####################### -->
</head>
<!-- ####################### don't forget to copy the body code! ####################### -->
<body onLoad="setUpDMA()">
<!-- ####################### copy the code below to where you want the menu to appear ####################### -->
<form name="formDoubleMenuDMA" >
<p><font size="2">Select a subject and then a page to go!</FONT>:<br>
<!-- This menu holds the subjects-->
<select name="menuSubjectsDMA" onChange="changeFilesDMA()">
<option value="none" >Select a subject
<option value="">1-4
<option value="">5-10
<option value="">11-14
<option value="">15-18
</select>
<!-- this menu holds the files to go-->
<select name="menuFilesDMA" onChange="goDMA(this)" style="width:300">
<option value="none"> Pages appear here
</select>
<p>
</form>
<!-- ####################### stop copying the menu code (DMA) here ####################### -->
</body>
</html>
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 6:01 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC