Function{}

L

ljack

Hi,

I have this java script:

function ClassList(cntrlname){

execfile="../scripts/mgrqispi.dll?
APPNAME=SMARTWeb&PRGNAME=ClassList&ARGUMENTS=Course&Course="+cntrlname;

showBox=window.open(execfile,"ClassList","resizable=yes,toolbar=no,scrollbars=no,directories=no,menubar=no,width=700,height=430");

if(showBox !=null){
if (showBox.opener==null){
showBox.opener=self;
}
}
}

function MajorList(cntrlname){

execfile="../scripts/mgrqispi.dll?APPNAME=SMARTWeb&PRGNAME=MajorList&ARGUMENTS=Major&Major="+cntrlname;

showBox=window.open(execfile,"MajorList","resizable=yes,toolbar=no,scrollbars=no,directories=no,menubar=no,width=700,height=430");

if(showBox !=null){
if (showBox.opener==null){
showBox.opener=self;
}
}
}

And these are the html code:

<tr><td height="11" width="145">
<p align="right"><font face="Arial" size="2">Course</font></p></td>
<td height="11" width="788">
<span class="message-centre"><font class="pn-normal"><input
type="text" name="CourseCode" size="22" value="FKSS"><input type="button"
value="Browse"
onClick="ClassList('document.AdmissionCourse.CourseCode')"></font></span></td>
</tr>

<tr><td height="11" width="145">
<p align="right"><font face="Arial" size="2">Major</font></p></td>
<td height="11" width="788"><span class="message-centre"><font
class="pn-normal"><input type="text" name="MajorCode" size="22"
value="KA111"><input type="button" value="Browse"
onClick="MajorList('document.AdmissionCourse.MajorCode')"></font></span></td>
</tr>

How can i relate the browse button for the "major" to the "course".
Everytime i click on the Browse button (ClassList), then i select the value,
the values in the "MajorList" will correspond with the value selected in the
Classlist.

Example:
Course(Class) -->MajorList
A----------------->1
A----------------->2
B----------------->3
B----------------->4
B----------------->5
C----------------->6
C----------------->7
D----------------->8

So, when i select A, the value in the MajorList will only display 1 and 2.
if i select B, the value in MajorList will only display 3,4, and 5.

I really hope someone can help me with this problem.

Thanx
 
C

Cowboy (Gregory A. Beamer) - MVP

Add a JavaScript on change for the Course. When it is fired, have it create
an array of the Majors and alter the drop down box with this list. I do not
have a script readily available, but you should be able to find one via
google. If you know of a site that does this (many do), consider viewing
source (or going to get the .js file out of your browser cache) and examining
how they did this.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top