hello to everybody!i'm new webdeveloper beginner!ι'll try to learn php,mysql,javascript and i think the best way to learn is to create something.ι decided to create a report generator tool for a web page.i have one table with 3 columns ans 3 rows.in this query i take all tables from a database and show it in the first column->>
<?

$tables ="SHOW TABLES FROM database_name like 'jos_vm%'";
$table_query=mysql_query($tables);
while($showtablerow=mysql_fetch_array($table_query))
{
?>
<input name="table_check_box" type="checkbox" value=<? echo "<br/>".$showtablerow[0]."<br/>"; ?></br>
<?
}
?>
every table has a checkbox and number of tables are 50!so let's go to my problem....i have a button and i want this button to check which checkboxes are checked and print it in the second column and after this step with sql query i'll take the fields from every table!so i write a javascript code but is wrong

<script>
function step1(chk1){
var total="";
for(var i=0; i < document.form1.table_check_box.length; i++){
if(document.form1.table_check_box[i].checked)
total +=document.form1.table_check_box[i].value + "\n"
}
if(total=="")
alert("select scripts") else
alert (total)

return false;
}
</script>

i hope to understand what i want to do!!