Sorry for posting again so soon however I am still stuck.
Below is a sample code of what I am trying to do:
<script>
function enableDisable0()
{
if(document.myform.tickbox1.checked == true)
{
var objects = document.getElementsByTagName("input");
for(var no=0;no<objects.length;no++)
{
objects[no].style.visibility = "visible";
}
}
</script>
<HTML>
<form method="POST" name="myform" action="">
<input name="Option1" type="checkbox" size="20" style="visibility: hidden;" />
<input name="Option2" type="checkbox" size="20" style="visibility: hidden;" />
<input name="Option3" type="checkbox" size="20" style="visibility: hidden;" />
Click this tick box to make others appear.
<input type="checkbox" name="tickbox1" value="ON" onclick="enableDisable0()">
</form>
</HTML>
What I want to happen is when someone clicks tickbox1 I want option1 option2 and option3 to appear,
Little run down on my situation.
I have a photo gallery written in PHP, what happens is when someone opens one of the gallerys, a php "while loop" is called which grabs all the photos in the users directory and outputs them as thumbnails. Each thumbnail also has a tickbox next to it (Option1, Option2, Option3) the tickbox is used so people can tick 1 or more photos then press delete to remove them, however I don't want the tick boxes to appear next to the thumbnails unless they first click a "Click to display delete options" tickbox first.
You can see from that, that I can not use the
getElementById
or
getElementByName
as every photos checkbox will have its own unique name and id, so I wanted to use the
getElementsByTagName (input)
Many thanks for anyone who can see why my script doesn't work.