473,378 Members | 1,409 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.

Bi-directional Dependent Dynamic List Menu

I'm looking to modify the javascript behavior on
http://research.yale.edu/%7Ekamusi/e...ners/index.php to do
two things:

Initial State: Both menus are populated with all their entries (as is
the case currently).

1. On selecting a topic, the Skills menu will only show those Topics
with dependencies (which will be provided) and vice versa.

2. On clicking the "Go" button, whichever combination (or just a Topic
or Skill) is selected and passed to the URL field.

Ordinarily, I'm a PHP dude and sweated enough to get the current
javascript working (javascript too finicky:(). On doing some research
(ie googling:) ), I have come across only uni-directional dependencies
(ie, "Skills" is dependent on "Topics", not vice versa). Anyone has any
idea of how to get this bidirectional dependency without creating some
sort of looping behavior(how I see it if I were just to tweak the
uni-directional code that DreamWeaver for example generates)?
Thanks,
paa.kwesi

Jul 23 '05 #1
1 3622
Fortunalty, Javascript can handle two dimensional arrays. This simple
script proove it:
var arraylev1 = new Array(2);
arraylev1[0] = new Array(4);
arraylev1[0][0] = "Topic1";
arraylev1[0][1] = "Skill1";
arraylev1[0][2] = "Skill4";
arraylev1[0][3] = "Skill5";
arraylev1[1] = new Array(4);
arraylev1[1][0] = "Topic2";
arraylev1[1][1] = "Skill1";
arraylev1[1][2] = "Skill7";
arraylev1[1][3] = "Skill12";
for(ii=0; ii<arraylev1.length; ii++){
for(iii=0; iii<arraylev1[ii].length; iii++){
alert(arraylev1[ii][iii]);
}
}
According to this, finding Skills related to an Topic should be easy.
The other direction requires you to write a custom parsing function, as
Javascript is not very rich in built-in array sorting functions.
Use that features to populate an array variable, and then parse it to
change the contents of your <SELECT AREA> by using the innerhtml method
or the DOM (appendChild, removeChild, setAttribute, etc...).
The URL will be computed using the {selectformforskillsName}.value and
the {selectformfortopicsName}.value properties. Generate a querystring
then a window.location.replace or auto-submit your form, which is better.

Another solution is remote scripting, but I do not think it is necessary.

This is some general ideas. I'd be pleased to give you more details.

pa******@gmail.com a écrit :
I'm looking to modify the javascript behavior on
http://research.yale.edu/%7Ekamusi/e...ners/index.php to do
two things:

Initial State: Both menus are populated with all their entries (as is
the case currently).

1. On selecting a topic, the Skills menu will only show those Topics
with dependencies (which will be provided) and vice versa.

2. On clicking the "Go" button, whichever combination (or just a Topic
or Skill) is selected and passed to the URL field.

Ordinarily, I'm a PHP dude and sweated enough to get the current
javascript working (javascript too finicky:(). On doing some research
(ie googling:) ), I have come across only uni-directional dependencies
(ie, "Skills" is dependent on "Topics", not vice versa). Anyone has any
idea of how to get this bidirectional dependency without creating some
sort of looping behavior(how I see it if I were just to tweak the
uni-directional code that DreamWeaver for example generates)?
Thanks,
paa.kwesi


Jul 23 '05 #2

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

Similar topics

0
by: DD | last post by:
Hi Guys! Just would like to share with you my experiense in this matter. I was trying to evaluate how suitable Oracle OLAP for our applications. As probably you did, I have downloaded from OTN...
0
by: V?ronique | last post by:
hi everyone, if you are a BI tool user, speak spanish, then you might be interested in decideo, which is a community of BI tool users. the newsletter is on: ...
0
by: YellowFin Announcements | last post by:
Announcing Yellowfin Version 2.4 release. (www.yellowfin.com.au) Existing SQLserver users can take advantage of this upgrade as soon as convenient. V2.4 Exciting changes in the latest...
3
by: ShihChengYu | last post by:
Dear all: How to convert color image to bi-level image? I have confronted one problem when I build my OCR project. I used an software API function to enhance my project, but the API only...
1
by: jimdandy | last post by:
Hi all, Am looking for some guidance/advice in terms of best practices for deploying a MS BI project. We have a relatively large BI system that we need to deploy between DEV/QA/UAT/PROD and...
0
by: YellowFin | last post by:
Yellowfin International today announced that Yellowfin has joined IBM's Partner Program, and that the Yellowfin BI Suite are now validated on IBM's popular DB2 9 database. This partnership opens...
0
by: WI Projects | last post by:
Hi, A CMM Level 5 company is looking for Microsoft Business Intelligence (MS BI) professionals for its Hyderabad location. There is a an element of onsite travel & work to this position. ...
15
by: rinmanb70 | last post by:
I use a db for keeping up with my checkbook and I'm having trouble setting up a new functionality. I get paid every two weeks on Friday, and I need a report to figure my balance that includes only...
0
by: YellowFin Announcements | last post by:
Yellowfin, Powered by J2EE, Jasper, BIRT, Spring, jfreeChart Advanta releases ATLAS BI using Yellowfin Business Intelligence 3rd of August, 2007 - Advanta Software, specialist software...
0
by: zyro | last post by:
Hi, This is Michael Bowen. I've put together cubegeek.com as a new and hopefully exciting site for the BI professional to network, share get information. This is the industry's first portal...
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...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.