#1 2016-06-07 16:25:37

karmacomposer
Member
From: Wesley Chapel, Florida
Registered: 2016-05-04
Posts: 84
Website

How do I choose from two dropdowns?

I have two dropdowns - one has the category and the other has the size

How do I combine the two to choose the right html page to load:

//ArrayGetItem "[emojiSelect.Items]" "[emojiSelect.ItemIndex]" "[emojiSelect.Event]"

If emojiSelect = "Misc" and sizeSelect = "16x16"
   SetVar "[iframeEmoji.Url]" "http://www.mfelkerco.com/emojiapp/www/app/misc16.html" "String"
   end if

What am I doing wrong?

Mike

Offline

#2 2016-06-07 17:04:33

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How do I choose from two dropdowns?

Hello Mike,

The only think "rare" in the above code is the use of the "[emojiSelect.Event]" variable to receive the selected dropdown item. Normally we do something like the DropDown app sample shown, something like the below one:

ArrayGetItem "[MyDropDown.Items]" "[MyDropDown.ItemIndex]" "[MyDropDownSelectedItem]"

Then the variable "[MyDropDownSelectedItem]" stores the selected item in our "MyDropDown" control. And the same can be said for other possible DropDown control, then, a code like the below must work:

// Get the selected item in "MyDropDown"
ArrayGetItem "[MyDropDown.Items]" "[MyDropDown.ItemIndex]" "[MyDropDownSelectedItem]"

// Get the selected item in "MyOtherDropDown"
ArrayGetItem "[MyOtherDropDown.Items]" "[MyOtherDropDown.ItemIndex]" "[MyOtherDropDownSelectedItem]"

IfEx "([MyDropDownSelectedItem] == 'A item') && ([MyOtherDropDownSelectedItem] == 'B item')"
  // Do whatever you wanted
EndIf

Hope the above can help you in some manner Mike.

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.