Hello Everyone,
I need some help to implement a filter on a dropdown list in a
jsp page using Javascript. I have got the filtering working in
Java code and jsp, but do not know how to use javascript to run the jsp on changes made to the dropdown.
Basically, I have three dropdown list, the first of displays the list of student names, second one displays list of exams taken and the last one displays exams passed. What I am trying to do is, when the user selects a student name from the first dropdown, it filters the second dropdown list and only displays the exams taken by the student name selected in the first dropdown. And similarly when the user selects exams taken from the second dropdown, it filters the third dropdown and only displays the list of exams passed by student name and exam name selected in the above two dropdowns.
I have got the filtering working in the java code and the filter works fine in jsp, providing I keep presses the refresh button. I need help with the Javascript event.
Below is my code in jsp:
Here is my explanation of the above:
1. The first dropdown simply creates a list of student name by using method <%=student.getList(stuForm.getStudentID())%>
2. The second dropdown creates a list of exams details by taking in a value returned by stuForm.getStudentID(), and if the dropdown was already selected then it would display the current value returned by stuForm.getExamID()
<%=exam.createList(stuForm.getStudentID(), stuForm.getExamID())%>
3. The third dropdown creates a list of exam passed by taking in values returned by stuForm.getStudentID() and stuForm.getExamID() and if the dropdown was already slected then it would display the current value returned by stuForm.getPassID()
I hope I am making sense. Again I need help with javascript that could pass the right IDs and run the method on clientside based on changes in the dropdown. I am a newbie in javascript and would really appreciate any help and guidance.
Thanks
Zub
[ March 23, 2008: Message edited by: Bear Bibeault ]
[ March 23, 2008: Message edited by: Bear Bibeault ]
[ March 25, 2008: Message edited by: Zubi Pen ]
[ March 25, 2008: Message edited by: Bear Bibeault ]