What exactly is not working? Can you post the code that you tried?
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/
What exactly is not working? Can you post the code that you tried?
I am trying to extend your dynamic list example to work for 3 drop down lists.
The name of lists are
1.typeList
2.dynamicList
3.colorList
here is the code i am trying to extent.
var selectedValue = this.value;
var data = { 'fruits': ['orange', 'apple', 'banana'],
'vegetables': ['onion', 'carrot', 'tomato']
'color': ['green', 'yellow','orange','red', 'brown']
};
var dropDown3 = $('[name=colorList]');
dropDown3.html('');
var newData = data[selectedValue];
for(i = 0; i < newData.length; i++) {
dropDown3.append('' + newData + '');
}
dropDown.selectmenu('refresh');
so basically if fruits and banana was chosen from list 1 & 2 then the colorList should be filtered to show just "yellow".
I have it working for 2 but I can get it working for 3.
There is other ways using Switch case statements but i would like to use the JavaScript from your tutorial as i have used it on other screens and would like to keep my code consistent.
Thanks again Max
You are missing a comma after "'tomato']". There are might be other problems, but this is the first thing that I noticed.
I have put the comma in but it still didn't make a difference.
i require list 3 to show only what depends on what's select in list1 and list2.
Take example
'vegetables': ['onion', 'carrot', 'tomato']
there is one argument which says if vegetables is chosen then only display
'onion', 'carrot', 'tomato'
so my question is how do I give it 2 arguments which should only display in list 3 depending on selection in list1 and list2.
thanks Max
You will need to add if-statements to check what fruit or vegetable combination was selected. Use the Console window in Chrome Developer Tools to debug your app. You can always put console.log(value) to print values.
Ok Max thanks.
I'm not to well up on using java Script can you please get me started where to begin using the example above.
Thanks Max
If you Google, you will find large number of resources on how to use if-statement.