can not store values in cookies
Posted: Thu Oct 25, 2007 1:28 pm
Hello experts,
I want to set the values of my checkboxes into cookies when checked.Here is my code:
***** PLEASE USE TAGS WHEN POSTING CODE *****
My checkboxes are moving in a loop:
I can not set these ids .
Please help..
I want to set the values of my checkboxes into cookies when checked.Here is my code:
***** PLEASE USE TAGS WHEN POSTING CODE *****
Code: Select all
function keepID(value)
{
i = 0;
var ca = document.cookie.split(';');
for(i=0;i<<?php echo $_SESSION['row'] ?>;i++)
{
if(document.myform.chkID[i].checked==true)
{
ca[i]=value;
}
}
}Code: Select all
<input type="checkbox" name="chkID[]" id="chkID" value="<?=$rowSubjects['ID']?>" onClick="keepID(<?=$rowSubjects['ID']?>)">Please help..