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.
My problem here is how to populate checked and unchecked checkboxes from database.
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. 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, /> ....
Problem 2 :: Next time the user will login he will see in the form all the skills and his skills are checkec.
Are you looking for help with checkboxes or do you not know how to query a database to get the needed values?
Joined: Jun 26, 2001
Hi, I know how to query the database, to get the result I have only to join this two tables : table : const_skills (skilID , value). table : lookup_skills (lkupID, userID, skilID).
using userID = userid from the session after login, so what to do after getting all the pairs (skillID, value) from the resultSet to show all the element in the table const_skills and all matching values are checkec. thanks