In my photo album, using php to write a hidden field into the page.

Code:
<input type='hidden' value='$hiddenstr' name='$counter'>
$counter = "imagestr#" and the number is 1 through 9
$hiddenstr = "a,b,c,d,e" (for example)

I am using the following code to 1) change the image of image to that of the source and 2) write the text from that hidden field into a div tag.

Code:
<script>
  function showPicture(filename,imageid){
    document.images["PictureBox"].src = filename;
    document.getElementById("imagecontents").innerHTML = document.imageid.value
  }
</script>
I am using the following line
Code:
Javascript:showPicture('photo_album/$subcatagory/$folder/$entry',$counter)
the first value is the pathway to the image and the second is the name of the hidden field.

Can anyone help me get the text to display? I got the image to work but I can get the text from the hidden field to appear in a div tag. Thank you for the help.