Page 1 of 1

Drop down menu and adding "events" to each item in the menu.

Posted: Wed Oct 24, 2012 5:47 pm
by Chadd Smith

I have add a drop down menu on one of my pages that when selected should drop down five different items. Based on which one of the items the user clicks on, I would like to have the app navigate them to the corresponding page.
When I try to add an event to the drop down menu, I can not figure out how to assign a different event for each item in my drop down menu. Can you please tell me how this is done.

Thanks in advance for your help on this one.


Drop down menu and adding "events" to each item in the menu.

Posted: Wed Oct 24, 2012 5:53 pm
by maxkatz

Events are assigned to the component itself, not to individual items. That's just how HTML works. You should use Value Change event and then check which option was selected.


Drop down menu and adding "events" to each item in the menu.

Posted: Thu Nov 01, 2012 1:32 am
by Chadd Smith

Thanks for getting back to me on this one. I have been trying to setup the drop down menu as you suggested but can not seem to figure it out. For your suggestion of using the Value Change event and then checking which option was selected, is that something that can be done through the tiggzi program or must it be hard coded? If it something that can be done through the tiggzi program would you be able to provide me with some type of example so I try and work through this?
Below I have provided another example of what it is that I trying to accomplish with the drop down menu:

My drop down menu has five levels which are numbered 1 through 5, if a user selects "2" I would like the app to redirect them to "page 2".

Thank you once again for any help or insight you can provide on this one for me.


Drop down menu and adding "events" to each item in the menu.

Posted: Thu Nov 01, 2012 3:21 am
by maxkatz

Add Value Change event
Add Run Custom JavaScript action with this code:

code
var value = Tiggzi('component_name').val();
if (value == "2") {
Tiggzi.navigateTo('page_name', {});
}
/code