This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes CheckBox and Database interaction Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "CheckBox and Database interaction" Watch "CheckBox and Database interaction" New topic
Author

CheckBox and Database interaction

nash avin
Ranch Hand

Joined: Nov 18, 2004
Posts: 45
Hi All,

I would like to thank everyone for their advice to me in these forums.I have another situation here.Hopefully this is the right forum to post this message.

I have a .jsp page which contains checkboxes.The jsp is arranged into
COURSES SECTION and QUESTIONS.

Under each one of them there are check boxes.Under the COURSES and SECTION column, the checkboxes have associated values obtained from an Access database.

The QUESTIONS column has checkboxes, that have hard coded values(questions), written in html.The answers to these questions lie in a MS Access database.

I would like to know how I can check some checkboxes(checkbox value is already obtained from the Access database as told) in COURSES, some in SECTION(value already obtained from the database) and some in QUESTIONS , so that I can get the answer to that specific question I have checked pertaining to the COURSE and SECTION.Hopefully I have explained my problem correctly.

Any help would be greatly appreciated once again.Some leads as to how it could be done, along which lines.

TIA
AS
Frederic Filiatrault
Ranch Hand

Joined: Jul 12, 2004
Posts: 69
Hi Tia,

Ok. Here`s some modest suggestion to help you out.

First I would consider putting your questions in the DB. So your JSP files will be smaller (with a FOR loop) and also, will let you create the question list dynamically (so, any changes after you will automatically reflected).

Second, always in DB, I would create a table for the association between your question mapping with the correct COURSES * SECTION.

one thing FOR SURE, I you want to do it dynamically, I strongly suggest that you use JavaScript on the client side to interact with the client`s selection.

So, you will have (with your JSP file) to load into the HTML, the answer values. I would load them a pure JavaScript variable declaration (like an array). This way, all your answers would be ready to be found with your JavaScript.

I`m almost 100% sure of my solution.
But I do encourage other people to suggest other (and maybe better) solutions.

I love those kind of question !!!


F.<br />SCJP, SCJD, SCWCD, SCBCD<br /> <br />Failure is not an option... It comes with the software bundle.
nash avin
Ranch Hand

Joined: Nov 18, 2004
Posts: 45
Hi,

Thanks for the suggestion.I will see what best can be done regarding what you have told.Will post for further enquires.

Thanks again
AS
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: CheckBox and Database interaction
 
Similar Threads
check boxes retrieving problem
Kindly help me with this checkbox issue
vertical checkbox display
how do we pass the changed values of the checkboxes from the JSP to the ActionForm
Selection of check boxes