I need help on both the visual and the programmatic end of this one. Ok, so I’m allowing the user to edit certain rows pertaining to his unique ID. When the user clicks edit, it shows all of the rows in the user table that contain his specific ID (see below for the table layout). Furthermore, a checkbox is generated for each class the user appears in (again based on the user_id field).
tbl_user user_id | user_name 1 | Evan tbl_class user_id | class_id 1 1 1 2
This is what the edit form currently looks like:
| TEXT-BOX | For user_name | CHECKBOX value="1" | For EACH class found | CHECKBOX value="2" | For EACH class found
When the form is submitted, I was going to check to see if the values of any of the boxes were unchecked; if they were, I would remove the corresponding tbl_class row (wherever the class_id matched up).
Two problems I’ve encountered using this method:
- If the checkbox is unchecked, its value does not come through the form (so it seems)
- This isn’t so much a problem as it is an annoyance- is there a better way to go about doing this? I really hate the design.
I would appreciate help with either of the above questions.
Thank you!
Evan
http://postimage.org/image/e1sny3dcx/
I have uploaded an image at above link, of what i think a more user friendly design.
On Edit user details page, user can edit his user name through text box.
Also ‘Available Class ids’ are shown in list box with multiple select option and ‘Selected class Ids to Remove’ will contain the Ids user wishes to remove. The button ‘>>’ this in between transfers the selected class id from ‘Available class id’ list box to ‘Selected Class Ids to remove’ list box , while button ‘<<‘ does the vice verse.
It also give you flexibility if you tomorrow wants to identify the new class ids to add.
you can simply add on some event to the Available Class Ids List.
The design gives you advantage to clearly identify through form elements which are the class id’s you want to remove.I would recommend this approach in case there a more class_id’s pertaining to a user_id.