Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder thindrakhya's Avatar
    Join Date
    Jun 2007
    Posts
    90
    Thanks
    8
    Thanked 0 Times in 0 Posts

    getting two values from 1 check boxes

    hi

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

    eg


    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

  • #2
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    <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?

  • #3
    New Coder thindrakhya's Avatar
    Join Date
    Jun 2007
    Posts
    90
    Thanks
    8
    Thanked 0 Times in 0 Posts
    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

  • #4
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    If you are using javascript to get the info then just put the class id in the value and then:

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

  • #5
    New Coder thindrakhya's Avatar
    Join Date
    Jun 2007
    Posts
    90
    Thanks
    8
    Thanked 0 Times in 0 Posts
    thanks dude ,
    just what i wanted


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •