Agon Bina
Posts: 0
Joined: Thu Oct 04, 2012 5:01 am

saving current selected option from a 'select menu' component to a local storage variable?

I am trying to save the 'selected' part of a 'selected menu' component to a local storage variable using the 'set local storage variable' event after a button is clicked but for some reason won't work. When I do that for an input elemnt it works. It isn't working for a selected menu component only , or maybe I am doing something wrong. Can you please clarify, or help me?

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

saving current selected option from a 'select menu' component to a local storage variable?

Use this:

code
var value = Tiggzi('menu').val();
localStorage.setItem('someName', value);
/code

Using 'Set Local Storage Variable' won't work as the 'value' property is not exposed there.

Jersey Customs Web & Game Creations
Posts: 0
Joined: Fri Oct 05, 2012 10:33 pm

saving current selected option from a 'select menu' component to a local storage variable?

I got it to save this way but now I can't get the menu to show the saved value.

I have tried customs javascript "on load" like on a html page with getItem, but it doesn't work, neither did "get property" as the value isn't loaded.

Please help

Jersey Customs Web & Game Creations
Posts: 0
Joined: Fri Oct 05, 2012 10:33 pm

saving current selected option from a 'select menu' component to a local storage variable?

var value = Tiggzi('FullPart1').val();
localStorage.setItem('FullPart1', value);

var value = Tiggzi('FullPart1').val();
localStorage.getItem('FullPart1', value);

What I want to do is save the menu value and repopulate that same menu when I reload like I do in HTML. I have used it like the kilo demo that Jonathin Stark did with the phonegap tutorial.
It works on the app I made, but I like Tiggzi better and am going to switch to this for my apps! Great Product and can't wait to see what else can come from it. But I need to get past this first lol.

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

saving current selected option from a 'select menu' component to a local storage variable?

This will not work:

code
localStorage.getItem('FullPart1', value);
/code

getItem(..) takes just one argument, the key for the value you want to retrieve.

It would be:

code
localStorage.getItem('FullPart1');
/code

Once you get the value, you will need to update the drop down, an example is here:
http://help.gotiggr.com/getting-start...

Jersey Customs Web & Game Creations
Posts: 0
Joined: Fri Oct 05, 2012 10:33 pm

saving current selected option from a 'select menu' component to a local storage variable?

I'm sorry I've tried multiple ways I just don't get how to put the string and tutorial you gave me together. Can someone please put the code together and post that. I'm missing something.

Thank You

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

saving current selected option from a 'select menu' component to a local storage variable?

You select a value from a drop down list, save it into local storage and then want to add the value to the (same) drop down list?

Jersey Customs Web & Game Creations
Posts: 0
Joined: Fri Oct 05, 2012 10:33 pm

saving current selected option from a 'select menu' component to a local storage variable?

no I want them to fill a form out. click save, then when they revisit the page the values they put are still there viewable and editable. It works with text boxes, datepickers, and the dropdowns in the phonegap app I made. but not in the dropdowns in tiggzi.

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

saving current selected option from a 'select menu' component to a local storage variable?

Tiggzi is just the builder, it uses jQuery Mobile components.

How did you retrieve the values and set them into components in the PhoneGap app? If you have code, that would help.

Return to “Issues”