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

Create Cookie for Multiple Fields and then Retrieve on Load

Hello Tiggzi Support,

I am trying to create a cookie for multiple input fields. The input fields are:

-salespersonName
-salespersonCompany
-salespersonPhone
-salespersonEmail
-salespersonTitle

I am currently trying to set the cookie for just the top field, my code is:

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

The alert function is to make sure it is working. When I change the value of the input, I get a pop-up that says [object] [Object].

Any ideas would be much appreciated.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Create Cookie for Multiple Fields and then Retrieve on Load

Hello!
Did you connect jQuery plug-in for cookie support?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Create Cookie for Multiple Fields and then Retrieve on Load

Try replacing:codeTiggzi('AccessoryAmount').text();/code
with:codeTiggzi('AccessoryAmount').val();/code

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

Create Cookie for Multiple Fields and then Retrieve on Load

No luck. Same pop-up that says [object] [Object].

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

Create Cookie for Multiple Fields and then Retrieve on Load

Do you have a component named 'AccessoryAmount'?

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

Create Cookie for Multiple Fields and then Retrieve on Load

Then this will not work:

Tiggzi('AccessoryAmount').text();

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

Create Cookie for Multiple Fields and then Retrieve on Load

I had that typo, but after changing it still does not work. My current code is:

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

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

Create Cookie for Multiple Fields and then Retrieve on Load

You need to debug your code.. put console.log(..) statements and see what values you get.

Return to “Issues”