• Post Reply Bookmark Topic Watch Topic
  • New Topic

how data from a database can be put into checkboxes

 
nash avin
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I must thank this forum for being friendly and very helpful.I have another question here.I hope that this is the right forum for this post.

I have a MS Access database, which has a table with attributes.I am using Java 1.4.2 and Tomcat 5.0.28.

I want to display on a .jsp page the values present in the "courses" attribute of the database table.

The displayed courses should have "check boxes" associated with them, so that any of them can be checked and on submit must give the other entries associated with that checkbox(course).I hope my problem statement is clear.

It would be great if people could spend some time to read this message and guide me in the right direction.

Any help would be greatly appreciated

TIA

AS
[ February 21, 2005: Message edited by: Bear Bibeault ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nash:
What part of this are you having trouble with?

Are you able to retrieve the values from the database?
Are you having trouble with the HTML?
 
nash avin
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for the response. I wanted to ask the forum if people can explain to me how it could be done.

I can get values from the database table, corresponding to the column name, how do I make each value correspond to the database entry.I hope you are getting my point here.

It would be great if I am told what are the possibilities that I need to explore.

TIA
AS
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by nash avin:
Hi,
Thanks for the response. I wanted to ask the forum if people can explain to me how it could be done.

I can get values from the database table, corresponding to the column name, how do I make each value correspond to the database entry.I hope you are getting my point here.

It would be great if I am told what are the possibilities that I need to explore.

TIA
AS



On the HTML end, it's pretty simple:


The first checkbox will appear checked and the second one will be unchecked.

So,
As you are looping through your data structure returned from the database, write " checked " to the input fields for each "true" and write nothing for each false.

There is a good chapter in this book:
http://pdf.coreservlets.com
that covers all the elements in an HTML form.

It's also got a chapter on JDBC with examples that tie the two together.
 
nash avin
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the reply and suggestion.I will definately look into the pdf file and develop from there on.

Hopefully will be easier when I progress.

Thanking you again
AS
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!