View Full Version : getting two values from 1 check boxes

09-03-2007, 12:58 PM

i am displaying the registered users with thier class id with check boxes for the moderator to delete the add/delete the users


class id name user_id user_name checkbox

2 abc 4 john

i am using smarty templating system but that have nothing to do this problem

<td><input name = "{$smdata.user_id[id]}" type = "checkbox" value = "{$smdata.user_id[id]}" ></td>

now when moderator click on check boxes i will get the userID of the user but i also want to get the class id as well

Any idea how i can do this

one thing more , initially i was not using class id so if user checks multiple check boxes i can get the array and can delete multiple values but now as i have class id as well how can i delete the users as some of them will have the different class ids

09-03-2007, 01:10 PM
<input name = "{$smdata.user_id[id]}" type = "checkbox" value = "{$smdata.user_id[id]}" >

Why do you need that as the value if it's the name?

09-03-2007, 02:01 PM
i am just conernet with the value
i am using Java script to get the value of check boxes
i have nothing to do with the name

09-03-2007, 03:29 PM
If you are using javascript to get the info then just put the class id in the value and then:

var userid = input.name;
var classid = input.value;

09-03-2007, 04:10 PM
thanks dude ,
just what i wanted