I have a page that has various images that are randomly put on it from a database. The database has an ID field and a field that stores the images file path. I display the picture associated with the file path, and I also have a checkbox next to the image. The checkbox is named chk_ID where ID is the ID of the image from the DB. The total number of images varies depending upon what search criteria the user enters. What I want to do is to only allow the user to select up to six of the images. If they try to select a 7th, an alert pops up telling them they can only have 6 images selected. Any ideas?