Populating Drop Down Menu from database

Reply

Join Date: May 2008
Posts: 1
Reputation: vanipriya is an unknown quantity at this point 
Solved Threads: 0
vanipriya vanipriya is offline Offline
Newbie Poster

Populating Drop Down Menu from database

 
0
  #1
May 17th, 2008
Hi all,
I have two MS-Access Databases.
1.Comp with fields CID, CName, CMarks.
2.Stud with fields SID,SName,SMarks.

I use JSP to build the form in NetBeans.

I want to create a form which would allow me to choose a CName from a drop down menu. When I submit, it should check CMarks select all records in Stud where SMarks>=CMarks.

I do not have a problem, in writing the SQL for CMarks and Selecting Stud Records.

But I would like to know, how to dynamically populate the drop down box, in jsp.

Thanks,
Vanipriya/
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Populating Drop Down Menu from database

 
0
  #2
May 18th, 2008
create a servlet that fills some memory structure (most likely a Map) with the data needed to create the rows of the dropdown, and in the JSP use a JSTL <forEach> tag to create the option elements.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC