Page 3 of 6

save text input to selectmenu

Posted: Fri Jan 18, 2013 8:36 am
by Maryna Brodina

Sorry, not sure I understand you. Could you clarify you question please?


save text input to selectmenu

Posted: Fri Jan 18, 2013 12:21 pm
by Michael4771079

Sorry Marina,
I should have explained better. I want the user to be able to add co. name and email to an array in local storage, I intend to then set property to a selectmenu in order for the details to be used with sendgrid


save text input to selectmenu

Posted: Fri Jan 18, 2013 1:26 pm
by Maryna Brodina

Use this code on button click

codevar selectData;
selectData = JSON.parse(localStorage.getItem('selectData'));
if (!selectData) {
selectData = [];
}
selectData.push('{"email": "' + Tiggzi("coemailtextinput").val() + '", "name": "' + Tiggzi("conametextinput").val() + '"}');
localStorage.setItem('selectData', JSON.stringify(selectData));/code

To get saved results (if you need it) you can use next code

codevar selectData;
selectData = JSON.parse(localStorage.getItem('selectData'));
if (!selectData) {
selectData = [];
}/code

After that in selectData will be an array with objects {"email": "...", "name": "..."}


save text input to selectmenu

Posted: Fri Jan 18, 2013 2:39 pm
by Michael4771079

sorry Maina,
I struggling here,

I created a test project with the same component names (conametextinput, coemailtextinput, taxicoselectmenu)

on click I ran the code above, no result
I am unsure where to put the code to get the data


save text input to selectmenu

Posted: Fri Jan 18, 2013 6:14 pm
by Kateryna Grynko

Hello,

Maybe component names you use are not the same.. You mentioned "conametextinput_name" and "conametextinput". Is it the same component?

Please check all the component names in your app again...


save text input to selectmenu

Posted: Fri Jan 18, 2013 7:30 pm
by Michael4771079

Hi Katya,
thanks for your help on this,

I need to start this again as I don't think I explained it properly to Marina

Here is what I am trying to achieve

  1. In taxicompanies screen, I need the end user to be able to save in localstorage a company name and company email to the label and value of a selectmenu in a sorted alphabetical array (sorted by label, i.e company name)

    components names on this screen "conametextinput, coemailtextinput and taxicoselectmenu

  2. I need the end user to be able to delete an entry if they wish onclick, on delete button and refresh list (same screen)

    3 and then I need the end user to be able to select a company from a selectmenu on bookscreen, which I can map the value to sendgrid

    component name taxiselectmenu

    What I have done

    oc click I have I have run custom js this is the code
    codevar newOption = '<option value=​"' + Tiggzi("coemailtextinput")&#46;val() + '">' + Tiggzi("conametextinput")&#46;val() + '<&#47;option>';
    Tiggzi("taxicoselectmenu")&#46;append(newOption)&#46;selectmenu('refresh');/code

    this code is saving company name to taxicoselectmenu

    the code Marina gave me today I did not use as I have all ready said I didn't explain this issue to her properly, hope you understand, I can share the app if you wish.
    cheers


save text input to selectmenu

Posted: Fri Jan 18, 2013 7:40 pm
by Kateryna Grynko

Yes, please share the app with support@tiggzi.com


save text input to selectmenu

Posted: Fri Jan 18, 2013 7:44 pm
by Michael4771079

shared Katya


save text input to selectmenu

Posted: Fri Jan 18, 2013 8:07 pm
by Kateryna Grynko

What is the app name you've shared?


save text input to selectmenu

Posted: Fri Jan 18, 2013 8:11 pm
by Michael4771079

Katya,
just shared again (sometaxi)