aspose file tools*
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
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: 61218
    
  66

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in JSP with respect to combo box.