The second $row[0] inserted after '</font>' is just to make sure that each $row[0] entered in to the table has the id from the database.The problem is that all I get from the checkbox is a value of 1 for the $row[0].Here's the javascript.

The 'visitcount' works fine, but not the value for $row[0].I've tried many combinations using single quotes, double quotes etc, but I get either 'on' suggesting no value is attached to the checkbox or 1. If I replace the $row[0] with a number then I get that number showing in the js alert box.Anyone tell me what I am doing wrong here, please?

How many check boxes like this are there? Is there more than one, because it seems like you are looping through multiple records.

When are you calling the javaScript? Since you are only passing the class of the check box and there are many boxes on the form, only the first one is actually grabbed on execution of this script.

If you wanted to change this, you would probably want to call this script onchange of the check box value and then just use the "this" keyword. Either that or you need to more distinctly call out which check box you are trying to get the value of.

Further to my post...What I am trying to do is to detect which records from the database the user has selected. The user can click on the checkbox called Visit to indicate the places to visit. The current javascript counts the number of checkboxes that are ticked. What I want to do is to attach the id of the record to the associated checkbox and then create an array of record ids from the checkboxes that are ticked. From this array I want to print out only the records that match the ids.