473,378 Members | 1,447 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,378 software developers and data experts.

multiple list/menu

234
Please help.

I'm first start to use javascript but I don't know how to develop the
captioned.

e.g.
<select name="select" onChange="change(this.options.selectedIndex)">
<option value="0">---Please select---</option>
<option value="1">11111</option>
<option value="2">22222</option>
<option value="3">33333</option>
<option value="4">44444</option>
</select>

<select name="mySelect">
<option value="0">---Please select---</option>
</select>

Expected :
Select 11111, the "mySelect" show
<option value="1">123</option>
<option value="2">124</option>
<option value="3">125</option>
<option value="4">126</option>

Select 22222, the "mySelect" show
<option value="1">223</option>
<option value="2">224</option>
<option value="3">225</option>
<option value="4">226</option>

Select 33333, the "mySelect" show
<option value="1">345</option>
<option value="2">346</option>
<option value="3">347</option>

Select 44444, the "mySelect" show
<option value="1">444</option>
etc.

Jul 20 '05 #1
1 1506
234
Found out other example but still not work.

<script>
var groups=document.forms[3].select.options.length <===== forms[3] ???
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("333","463") <==== "333" expected result ??
"463" ???
group[0][1]=new Option("444","464")
..
..
..
var temp=document.forms[3].mySelect <==== temp equal mySelect ???
function change(x)
{
x = x - 1

if (x == -1)
{
for (m=temp.options.length-1;m>=0;m--)
temp.options[m]=null
temp.options[0]=new Option("-------------","")
temp.options[0].selected=true
}
else
{
for (m=temp.options.length-1;m>=0;m--)
temp.options[m]=null
temp.options[0]=new Option("- Please select -","")
for (i=1;i<group[x].length+1;i++){
temp.options[i]=new Option(group[x][i-1].text,group[x][i-1].value)
}
temp.options[0].selected=true <=== Completed this statement will
pass to mySelect select option ???

}
}

</script>


----- Original Message -----
From: "234" <23*@234.com>
Newsgroups: comp.lang.javascript
Sent: Friday, March 05, 2004 12:04 AM
Subject: multiple list/menu

Please help.

I'm first start to use javascript but I don't know how to develop the
captioned.

e.g.
<select name="select" onChange="change(this.options.selectedIndex)">
<option value="0">---Please select---</option>
<option value="1">11111</option>
<option value="2">22222</option>
<option value="3">33333</option>
<option value="4">44444</option>
</select>

<select name="mySelect">
<option value="0">---Please select---</option>
</select>

Expected :
Select 11111, the "mySelect" show
<option value="1">123</option>
<option value="2">124</option>
<option value="3">125</option>
<option value="4">126</option>

Select 22222, the "mySelect" show
<option value="1">223</option>
<option value="2">224</option>
<option value="3">225</option>
<option value="4">226</option>

Select 33333, the "mySelect" show
<option value="1">345</option>
<option value="2">346</option>
<option value="3">347</option>

Select 44444, the "mySelect" show
<option value="1">444</option>
etc.

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Sandman | last post by:
I have a script that generates a hierarchical menu, but I am having problems assigning styles to each manu items different possible states. The possible states a menu item can be in is (and all of...
3
by: rhamlin | last post by:
I'm fairly new to creating complex sql statements and need a little help. In plain english I want to do this: Select menu rows where the row's userGroupIDs equal the user's userGroupIDs. ...
7
by: Siv | last post by:
Hi, I have an MDI application that uses a generic "ShowPage" routine in a module that is called when I want to display a child form. The basic idea is that in the module I have declared each form...
2
by: webfreak | last post by:
hello am a relative newbie to php. am using dreamweaver,php/mysql. i want to populate a mysql field using a multiple selection list menu. i have been to countless forums and so far nothing. can...
1
by: Zak | last post by:
Hello, I need some help trying to grab the data selected from a checkboxlist. The checklist is acting like a menu. The first selection is accepted but not the multiple ones. For example is the...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
3
by: Gary | last post by:
Hi all, I am writing an application which will intake arguments of filenames for processing: e.g. MyApp.exe "C:\abc.txt" "C:\def.doc" - then, MyApp will process the 2 files by parsing the...
1
by: helloise | last post by:
i want to do the following: 1. Click a button on Main menu. 2. Close main menu ( I would use hide if possible) 3. Open form2 4. Open other forms and hide or close the previous form. \\ will ...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.