Page 2 of 2

Create Cookie for Multiple Fields and then Retrieve on Load

Posted: Tue Feb 26, 2013 5:50 pm
by Ryan Bloom5585665

I have also tried to stringify the cookie:

function setCookie(salespersonNamecookie) {
document.cookie = salespersonNamecookie=JSON.stringify(Tiggzi('salespersonName').text());
+ "expires=Fri, 16 May 2025 18:40:22 GMT";
alert($.cookie(salespersonNamecookie));
}

With this code, it alerts "null"


Create Cookie for Multiple Fields and then Retrieve on Load

Posted: Tue Feb 26, 2013 6:00 pm
by maxkatz

Before you combine any strings, make sure that this returns the correct value:
Tiggzi('salespersonName').text();

If 'salespersonName' is an input component, then you need to use .val();


Create Cookie for Multiple Fields and then Retrieve on Load

Posted: Tue Feb 26, 2013 6:20 pm
by Ryan Bloom5585665

I have it now set to be .val. I also did an alert, (alert(Tiggzi('salespersonName').val());). The alert popped up the correct information. But when I try to alert the cookie it still pulls up a "null" message.


Create Cookie for Multiple Fields and then Retrieve on Load

Posted: Tue Feb 26, 2013 6:40 pm
by maxkatz

Then you are not setting the cookie correctly. Try something simple as:

document.cookie="something=abc";

This document will help: https://developer.mozilla.org/en-US/d...