need a little help

wxdqz

New Member
Guys, i really apreciate you answering questions on this forum. I would also need some help, some ideas with the code i'm working on. Here's is what i have to do: i have to generate a code which basicaly works like this: when you select one thing in the 1st pulldownbox, into the 2nd one automatically be selected something else (i did that and it works!) but here is my problem: i have to make another pulldown box(3rd one) which has to be influence by the second one (the one which has been changed after selecting in the first box an option). I'll put down the code for the 2 boxes and hope some one will tell me how can i add the third box. Here is the code:
<SCRIPT language=JavaScript1.1>
<!--
if (typeof(Option)+"" != "undefined") v=true;
//-->
</SCRIPT>
<SCRIPT language=JavaScript>
<!--
function IsFormComplete(FormName)
{
var x = 0
var FormOk = true
while ((x < document.forms[FormName].elements.length) && (FormOk))
{
if (document.forms[FormName].elements[x].value == '')
{
alert('Please enter the '+document.forms[FormName].elements[x].name +' and try again.')
document.forms[FormName].elements[x].focus()
FormOk = false
}
x ++
}
if(FormOk){
document.form1.submit();
}
return FormOk
}
// -->
</SCRIPT>
<SCRIPT language=JavaScript>
<!--
if(v){a=new Array(220);}
function getFormNum (formName) {
var formNum =-1;
for (i=0;i<document.forms.length;i++){
tempForm = document.forms;
if (formName == tempForm) {
formNum = i;
break;
}
}
return formNum;
}
function jmp(form, elt)
{
if (form != null) {
with (form.elements[elt]) {
if (0 <= selectedIndex)
location = options[selectedIndex].value;
}
}
}
var catsIndex = -1;
var itemsIndex;
if (v) {
function newCat(){
catsIndex++;
a[catsIndex] = new Array();
itemsIndex = 0;
}
function O(txt,url) {
a[catsIndex][itemsIndex]=new myOptions(url,txt);
itemsIndex++;
}
function myOptions(text,value){
this.text = text;
this.value = value;
}
newCat();
O("0","Please Select");
newCat();
O("123","Mangement");
O("124","Economy");
O("125","Accounts");
O("126","Statistics");
O("127","English");
O("128","COmputers");
newCat();
O("130","Software");
O("131","Hardware");

}
function relate(formName,elementNum,j) {
if(v){
var formNum = getFormNum(formName);
if (formNum>=0) {

with (document.forms[formNum].elements["oper"]) {
for(i=options.length-1;i>0;i--) options = null;
for(i=0;i<a[j].length;i++){
options = new Option(a[j].text,a[j].value);
}
options[0].selected = true;
}
}
}
else {
jmp(formName,elementNum);
}
}
function IEsetup(){
if(!document.all) return;
IE5 = navigator.appVersion.indexOf("5.")!=-1;
if(!IE5) {
for (i=0;i<document.forms.length;i++) {
document.forms.reset();
}
}
}
window.onload = IEsetup;
//-->
</SCRIPT>


<p></p>
<form name="loginBOX" method="post" " onsubmit="return validateForm(this)">



<tr valign="top">
<td>Faculty:</font></td>
<td colspan="2">
<select class="pulldownbox" id=profesor onChange=relate(this.form,0,this.selectedIndex) name=faculty>
<option value=http://www.webdeveloper.com/forum/archive/index.php/0 selected>Please Select</option>
<option value=234>Mangement </option>
<option value=355>Computers </option>
</select>
</td>
<tr valign="top">

<td>Course</td>
<td colspan="2">
</tr>
<tr valign="top">
</tr>
<tr valign="top">

<select class="pulldownbox" id=oper name=oper>
<option value=0 selected>Please Select</option>
</select>
</td>
</tr>


Practically my question is: How can i insert the "Professor name" box so that after i selected the faculty - of management for instance, (in the second box will appear the courses) when i do select one course from those, automaticaly to show up the name of the proffesor in the last box?
 
Back
Top