Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checkboxes from a query ? how

Status
Not open for further replies.

mlotfi

Programmer
Oct 14, 2003
26
US


I am trying to do this :
when a user login he will be presented with a form that has his skills (he already submited in this form), now he can change his skilles by checking or unchecking the checkboxes and when submit all are saved in a table in a database.

table : user_table (userID, username).
table : const_skills (skilID , value).
table : lookup_skills (lkupID, userID, skilID).

My problem here is how to populate checked and unchecked checkboxes from database.
thank you.
 
Well, as you don't tell us your level of knowledge, I'll start from basis:

1.- You'll hava to generate the from in a JSP
2.- You'll have to connect to the database (see JDBC)
3.- You'll have to do the query (see PreparedStatement)
4.- You'll have to recover the data from the query (see ResultSet

Cheers,
Dian
 
Hi Diancecht,
Thank you for your reply,
Problem 1 ::
Let say a user login for the first time (now we have his userID in a session), then he has a form that lists :

Please check your skills :
checkbox1 JSP
checkbox2 JAVA
checkbox3 HTML

the when he submit the form, only the skills with checkboxes he checked are inserted in the lookup_skills table.

Problem 2 ::
Next time the user will login he will see in the form all the skills and his skills are checkec.

Please help me.
thank you again.
 
The same solution applies in both cases. The only thing that changes is a select or update query.

Cheers,
Dian
 
Hi,
the only thing I need is how to write :
<input type="checkbox".......
for each const_skills ????

thanks
 
My question here is how to construct the checkboxes in the form using the query : select * from const_skills ? in an other word :
<input type="checkbox" value= the first skilID from the query,
how to test the checked if it's false or true, />
<input type="checkbox" value= the 2nd skilID from the query,
how to test the checked if it's false or true, />
....



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top