• Post Reply Bookmark Topic Watch Topic
  • New Topic

Drop down menu and page refresh

 
Liz Costelloe
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anyone tell me is there a way to have a page refresh itself after an item has been selected from a drop down menu (without using a button).
My problem is that I have two drop down menus corresponding to two different tables; for arguments sake say menu1 and menu2 corresponding to table1 and table2 respectively.
When an item is selected from menu1 it refers to a PK in table1. I want the second drop down menu at this point to display all the PKs from table2 that have a FK matching the PK selected in menu1.
Can I get the page to refresh itself automatically to reflect the change? At the moment the only automatic refresh I'm aware of is based on a timer.
All help would be appreciated, thanks,
Liz
 
Ray Stojonic
Ranch Hand
Posts: 326
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do this with a little javascript.
Something like:

should do it.
This would submit to a servlet, which would add the contents of the second select to the session based on the selected item and return
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not much to do with JSP, so I'm shuffling this along to the HTML/Javascript forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!