This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes Two dropdowns - need to indicate to server side code the specific dropdown Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Two dropdowns - need to indicate to server side code the specific dropdown " Watch "Two dropdowns - need to indicate to server side code the specific dropdown " New topic
Author

Two dropdowns - need to indicate to server side code the specific dropdown

pendse anagha
Ranch Hand

Joined: Mar 09, 2005
Posts: 44
Hello ,
I have two dropdowns in my JSP page
The problem is - I need to pass an indicator as to which dropdown has been changed

Both the dropdowns are in the same form
I would like to know - if its possible to pass an indicator through Javascript
that can be picked up in Java code

Thanks in advance ,
anagha
[ May 16, 2005: Message edited by: pendse anagha ]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12268
    
    1
You are mixing up a lot of technologies here. In an HTML form, each SELECT input should have a unique name so you could simply compare the returned value with the value originally set as SELECTED.
Whether the HTML gets written by JSP or is a static page has nothing to do with it.
If you want JavaScript to watch form activities and make some report, you can do that with one or more hidden variables in the form. Hidden variables in forms appear as request parameters just like SELECT input variable.
Bill


Java Resources at www.wbrogden.com
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

This question would probably do better in the HTML/Javascript forum but here's one way:


You'll probably need to tweak it a bit to get it to work on older browsers.
[ May 16, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Two dropdowns - need to indicate to server side code the specific dropdown
 
Similar Threads
JSF dropdown components problem
Change values in dropdown dynamically
getting this Ajax code to work with jsp
Accounting year end for dropdowns in struts
Display a textbox after dropdown change