File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
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: 12760
    
    5
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
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://aspose.com/file-tools
 
subject: Two dropdowns - need to indicate to server side code the specific dropdown
 
Similar Threads
getting this Ajax code to work with jsp
JSF dropdown components problem
Display a textbox after dropdown change
Change values in dropdown dynamically
Accounting year end for dropdowns in struts