With the help of javascript i have created set Cookie() function. In the below code I have store all the values in the single cookie. By using this function many cookies will store at a time.
<script type="text/javascript">
var today = new Date();
var expiry = new Date(today.getTime() + 30 * 24 * 3600 * 1000);
function setCookie(name, value)
{
document.cookie=name + "=" + escape(value) + "; path=/; expires=" + expiry.toGMTString();
}
</script>
The setCookie function is called by the form using the following function:-
<script type="text/javascript">
function storeValues(form)
{
setCookie("field1", form.field1.value);
setCookie("field2", form.field2.value);
setCookie("field3", form.field3.value);
setCookie("field4", form.field4.value);
return true;
}
</script>
0 Comment(s)