My problem is that how to identify which row of the HTML table, a certain web server user have checked in order to perform edit or delete function. Table is printed to HTML using 'echo' inside a 'while()' loop, which loops till all the data in 'data1' table of the database is printed. I have used a field called 'sid' which is a var-char as my primary key and i'm trying to assign it's value to a check box which is in front of each row of the table. When i box is checked a java script execute and try to assign value of 'sid' to check box value so that later in my code i will be able to extract that value to run a MySQL query in order to perform the intended task. The problem is that though the js executes as a box being checked, an js error message appears saying that 'unable to get the value of property 'value'. object is undefined or null'. What happen to 'X'? I have tried several methods to correct and i have seen that when im doing this using only HTML and java script (no echo) check box value is properly assigned though that is without connecting to the db and without using php. May be i'm missing some concept here
???
Please understand that i have only recently started self learing php, mysql, html & js its not yet even week. what im telling is im sure there are many mistakes in my code and ill be most grateful if you can show them to me as well. I would like to do this simply as possible since i may not be able to understand very complex code at this moment. So thanx in advance everybody..

<head>
<script type="text/javascript">
function go_java()
{
var x=document.getElementById(index).value;
alert(x);
}
</script>
</head>
<h1>Database view</h1>
<body>
<form method="post" action="handle_update.php">
<center><strong>Edit row(s):</strong><input type="radio" name="edt" value="1">
<strong>Delete row(s):</strong><input type="radio" name="edt" value="2">
<input type="submit" value="go">
</form>
<footer>
nick.jay.r
</footer>
</body>
</html>



<?php
$user = 'root';
$pswrd = '';
$dbase = 'siteinfo';

mysql_connect('localhost', $user, $pswrd) or die('Connection failed'. mysql_error());
mysql_select_db($dbase) or die('Connection to db failed'. mysql_error());
$query="select * from data1";
$q_result=mysql_query($query) or die('query failed'.mysql_error());
echo "<table border=2>"."<tr><th><th>SITE ID</th><th>SITE NAME</th><th>EQUIPMENT TYPE</th><th>VLAN</th><th>MANAGEMENT IP</th><th>SUBNET</th></tr>";

while($row = mysql_fetch_array($q_result)){

$id = $row['sid'];
$na = $row['sname'];
$qe = $row['eqtype'];
$vl = $row['vlan'];
$ip = $row['mgip'];
$su = $row['subnet'];

//echo "$id<br>";
echo "<tr><td><input type='checkbox' name='box' id='index' value='$id' onclick=go_java(this)></td><td>".$id."</td><td>".$na."</td><td>".$qe."</td><td>".$vl."</td><td>".$ip."</td><td>".$su."</td><br/>";//fetch arry 1row at a time
}
echo "</table>";
mysql_close() or die('Connection close failed'. mysql_error());


?>