Ryan Bloom5585665
Posts: 0
Joined: Mon Feb 25, 2013 5:20 pm

Create Cookie for Multiple Fields and then Retrieve on Load

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"

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Create Cookie for Multiple Fields and then Retrieve on Load

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();

Ryan Bloom5585665
Posts: 0
Joined: Mon Feb 25, 2013 5:20 pm

Create Cookie for Multiple Fields and then Retrieve on Load

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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Create Cookie for Multiple Fields and then Retrieve on Load

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...

Return to “Issues”