• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

correct Ajax script syntax for second DropDown

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello eveyone,

I am new to Ajax and have been fiddling with it for the last couple of days. I am trying to get a dropdown filter to work. I have managed to sort out the filter for the frist dropdown using a Ajax script but cannot get the second drop down to work. I am not too sure to write the correct Ajax syntax. My question is on the second dropdown, how can I pass the id for the first onChange event and the second onChange event...

Here is my explanation on what I am trying to achieve,

When a user selects Student Name from the frist dropDown, then the onchange event runs the Ajax script
and filters the second Dropdown and displays all the exams details by the student name selected above. The code works fine uptill this point.

Now, when I select the second dropdown, I want it to take the value of the frist dropdown and the second dropdown and
then filter the third dropdown. I do not know the correct syntax in Ajax on how to pass the onChange event on the frist two dropdowns.

Here is my html dropdown code:

Here is the Ajax script I am using:

Here is the dropdownlist.jsp page that runs the Ajax and gets the values for the second dropdown..

My Question is how can I write the correct syntax for running the Ajax script on the onChage event of the
second dropdown?
[ March 28, 2008: Message edited by: Bear Bibeault ]
 
Zubi Pen
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok no reply so far! I think my post is a bit confusing. Let me explain from a different approach. I am using Using the rico.js file , I have the following script:


This passes "ajaxStudentID" to the file dropdownlist.jsp at the onChange event of the dropdownlist and filters the dropdown list below were div id = "examDropDownList". How can do the same filtering above but this time passing two values so the original "ajaxStudentID" and the onChange "value" of the second downdown, in order to filter the third dropdown.
 
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Zubi,

In your last post i ask you how you are implementing AJAX. See use a correct framework can help you in solving all the problems for AJAX. Just implement DWR framework for implementing ajax.
Please tell me are you using struts in you application.

Regards
 
Patricia Samuel
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Zubi

go through this link
http://www.javaworld.com/javaworld/jw-06-2005/jw-0620-dwr.html
and let me know if you face any problem implementing dwr in your application.

Thanks
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[Edit: thread hi-jack removed. Please post your own questions in a new topic.]
[ June 09, 2008: Message edited by: Bear Bibeault ]
 
"I know this defies the law of gravity... but I never studied law." -B. Bunny Defiant tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic