View Single Post
Old 06-21-2012, 12:25 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
When you have the current object referrer this in your code,
Code:
onclick=go_java(this)
you may change your javascript to
Code:
function go_java(elm)
{
alert(elm.id);
}
BUT, you can't have the same value of id applied to multiple elements, which makes the document invalid. So, you may need to append the auto-increment id to the value, like
PHP Code:
echo '<tr><td><input type="checkbox" name="box" id="index'.$row['sid'].'" value="'.$id.'" onclick="go_java(this)">'
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

Last edited by abduraooft; 06-22-2012 at 05:49 AM..
abduraooft is offline   Reply With Quote
Users who have thanked abduraooft for this post:
nickjay (06-21-2012)