473,387 Members | 1,553 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,387 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 3623
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: 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...
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...
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...
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,...

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.