Meaningless Drivel is fun!*
The moose likes JSP and the fly likes Problem in JSP with respect to combo box. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem in JSP with respect to combo box." Watch "Problem in JSP with respect to combo box." New topic
Author

Problem in JSP with respect to combo box.

Dipti Lokhande
Greenhorn

Joined: May 05, 2007
Posts: 9
JSP is as follows:

Student ID : combo box (select field)contains list of all student IDs
Student Name : Student Name is fetched from DB after selecting Student ID in combo box.
:
:

When student name is fetched after selecting Student ID in combo box, Student ID is set to the default ID means the selected Student ID is being lost.
Could you tell me how to restore the same student id even after fetching student name from database?
(If you can give any code sample, then that will be helpful for me.)

Thanks in advance.

Regards,
Dipti
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Add the selected attribute to the correct option tag when re-drawing the select box.



Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

For future terminology, a select element is not a "combo box".


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
wood burning stoves
 
subject: Problem in JSP with respect to combo box.
 
Similar Threads
in dropdown problem
skip value in logic: iterate
Replacing Entire Select Box
How to set selected value to combobox after refreshing page
Display same Data in JSP after reloading it