save text input to selectmenu
Sorry, not sure I understand you. Could you clarify you question please?
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Sorry, not sure I understand you. Could you clarify you question please?
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
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": "..."}
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
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...
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
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
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").val() + '">' + Tiggzi("conametextinput").val() + '</option>';
Tiggzi("taxicoselectmenu").append(newOption).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
Yes, please share the app with support@tiggzi.com
shared Katya
What is the app name you've shared?
Katya,
just shared again (sometaxi)