adi
Posts: 0
Joined: Tue Jun 26, 2012 8:09 pm

toggeling button state on event

i have a toggle button in my screen,
i would like to change his state according to local storage variable value.

i have this code to do the job but i don't know:

  1. on which event should this code fire i.e. on screen load? on screen show?

  2. how do i refresh the screen by code so that the button new state is shown?

    what i always see is its default state which is On.

    if(toggle_button.match(/on/i))
    {

    var input = Tiggr(toggle_button);
    input.val('on');
    alert (input.val());
    }
    else
    {
    var input = Tiggr(toggle_button);
    input.val('off');
    alert (input.val());
    }

adi
Posts: 0
Joined: Tue Jun 26, 2012 8:09 pm

toggeling button state on event

found it...it's not trivial to look for but its soooo simple once you get it
http://jquerymobile.com/demos/1.1.0-r...

Return to “Issues”