facebook

select-box issue : CLOSED

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #345364 Reply

    Hi,
    I’ve made a screen where I have a select box for gender. I save the selected value in a local storage key, but when I enter the screen the value shows is the first value in the option list. But clicking the select box – it shows the correct value.

    I’ve used this code to show the value from local storage – what am I doing wrong?

    $(‘#m1-profile-hidden-select-profile_gen’).val(localStorage.getItem(‘tds.dk_gen’));

    Attachments:
    You must be logged in to view attached files.
    #345372

    Hi TKT,

    Please try next snippet code and let me know how it goes.

    Saving value in localstorage:

    localStorage.setItem("val",$('select[name="combobox1"]').val());

    Retreiving value from localstorage:

      var cmbLastVal = localStorage.getItem("val");
      $('select[name="combobox1"] option[value="'+cmbLastVal+'"]').attr('selected','selected')
      phoneui.preprocessDOM('#m1-<screen>');
    #345375

    Hmmm…

    not sure I’m doing this right – no effect.

    When the screen is called “#m1-profile” how should this line be?

    phoneui.preprocessDOM(‘#m1-profile_localStorage’);

    OR??

    #345376

    Hi TKT,

    My bad, didn’t realize that the design I have was combo-localStorage. It should be just:

      phoneui.preprocessDOM('#m1-<screen>');

    I have corrrected snippet code shared previously. Let me know how it goes.

    #345377

    Octavia – You’r the man

    Thank you very much!

    🙂

    #345381

    Glad to help TKT, closing thread.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: select-box issue : CLOSED

You must be logged in to post in the forum log in