I have a form with 52 checkboxes that all have the same name (Day). I gave them all the same name because javascript will put them into an array and i can loop through the values easily. Now i need to send all these values to a php file to put the information into a database. I made a hidden input field for each day and now i would like to make a function that will loop through all the values of Day and assign a value to the corresponding hidden field accordingly. I gave all the hidden fields the same id "days". I tried to use getElementById but i don't think it is putting all the elements into an array. Any suggestions?
here's the function:
function assign()
{
var x=document.getElementById('days');
var z;
alert ("x " + x );
for(z=0; z<x.length; z++)
{
if (Day[z].checked)
{x[z].value = "T";}
else
{x[z].value = "F";}
alert ( x[z].vlaue );
}
}
Thanks!