• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in JSP with respect to combo box.

 
Dipti Lokhande
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add the selected attribute to the correct option tag when re-drawing the select box.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65129
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For future terminology, a select element is not a "combo box".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic