aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes Cascading Select statements using jQuery Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Cascading Select statements using jQuery" Watch "Cascading Select statements using jQuery" New topic
Author

Cascading Select statements using jQuery

Bai Shen
Ranch Hand

Joined: Sep 24, 2008
Posts: 323
I want to do something similar to what www.tirerack.com has. Where the options of one select statement depend on the selected option of another select statement.

I have my select statement firing an onChange event that calls the server to get the data. However, I'm having a bit of trouble trying to figure out how to put that data into the second select statement.

What way do y'all suggest I pass the data from the java servlet and populate the select statement with it?

TIA.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56224
    
  13

I just use a JSP on the server to format the <option> elements, and plunk them into the select element using .load().


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bai Shen
Ranch Hand

Joined: Sep 24, 2008
Posts: 323
Bear Bibeault wrote:I just use a JSP on the server to format the <option> elements, and plunk them into the select element using .load().


Interesting. I ended up with a somewhat similar solution. I used .get with a callback which did an .html on the select to load the options. But I think I like the .load solution better.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Cascading Select statements using jQuery
 
Similar Threads
executeQuery() issue?
displaying sql query results
refreshing the screen
insert statement is not working
Trying to extract text portion of select statement entry