views:

43

answers:

1

Hi, i have this form:

alt text

wich contains a list of students on the left and a lot of skills to assign to each student.

Each student have it´s own table with the full skill list (HTML, CSS, ...). Now whats a simple way to get value from the checkboxes and assign them to the corresponding student table?

The purpose is to creating a graph for each student showing their skillset :-) ah, sorry for my poor english.

A: 

Print the form using a scripting language like PHP. Use a smart naming for checkboxes, then put the logic to retrieve data in the script that receive the post form.

If you use php, u can use

<form>
    <input type="checkbox" name="paul[skill1]" value=1>
    <input type="checkbox" name="paul[skill2]" value=1>
    ...
    <input type="checkbox" name="robert[skill1]" value=1>
    <input type="checkbox" name="robert[skill2]" value=1>
    ...
</form>

when submitting the page, the $_POST result will be

$POST = array(
  [paul]   = array( [skill1]=> 1, [skill3]=>1) //paul has skills 1 and 3
  [robert] = array( [skill1]=> 1, [skill4]=>1) //paul has skills 1 and 4
)

if you want to do it everything on the frontend, you should use JQuery, but than managing data it's more difficult. I suppose you have PHP skills, otherwise use a Spreadsheet to do this

Elvis
Thanks Mr. Presley - i will try it later but it seems very good :-)
Lukas