Forum Moderators: open
Here is what I have:
A form that has anywhere from 1 to any number of rows (undetermined rows because the form is the result of a user search returning one result or hundreds of results.) Each result has a checkbox next to it.
What I would like to do is when the form is submitted, it stores the value for each checkbox in individual cookies. But I do not know how to place cookies when their is an undetermined number of rows.
Any help is so appreciated!
function get_check_value()
{
var c_value = "";
var c_name= "item";
for (var i=0; i < document.orderform.music.length; i++)
{
if (document.orderform.music[i].checked)
{
c_value = c_value + document.orderform.music[i].value;
alert(c_value);
var exdate=new Date()
exdate.setDate(exdate.getDate()+1)
document.cookie=c_name+i+ "=" +escape(c_value)+
((1==null)? "" : ";expires="+exdate.toGMTString())
c_value= "";
}
}
}