If/Else functionality

Hi there,

seeking assistance because I ran into a roadblock and couldn't get this to work. I'm trying to create a toggle option that reveals a dropdown menu containing different regions. Once a region is selected, specific information should display based on that choice. I managed to make the dropdown feature work on its own, but I haven't been able to successfully integrate it with the toggle functionality.

PS : I need it to start with the toggle, as there are several other options that need to be present before the dropdown menu appears.

I think you need an If toggle equals Yes statement after the toggle with the endif at the very bottom

Something like this should work:

...

{formtoggle: name=Show Regions; default=no}{formmenu: AU; NZ; UK}...
{endformtoggle}
...

I mean how do I make this work with if/else functionality. Once a region is selected, specific information should display based on that choice.

You would do something like this:

{formmenu: name=region; US; EU}
{if: region="US"}
You selected United States
{elseif: region = "EU"}
Tou selected Europe
{endif}

If you click on the "..." above the options for the menu in the sidebar, Text Blaze can create the if-conditions for you:

Hi Scott,

Thank you for your prompt response! I was finally able to make it work. I just want to ask if there's a way to filter out the dropdown choice so it doesn't appear in the actual outcome of the snippet?
For example, instead of getting 'USYou selected United States', I just want 'You selected United States' to show up.

Thankie

Yes, you can use the {note} command to wrap anything you don't want to be actually inserted.

You can learn more about it here:

Hi Scott,

Apologies, I don't think I explained the problem well. As you can see here, the drop-down for the snippet shows different regions as options for the prompt.

However, It also shows up here

Is there a way to filter it out?

Hi @Gerald_John_Amora1 ,
Yes, that's what Scott meant with the note command. Whatever is inside a note will show up in the pop-up but will not be inserted as text. Here's an example:

{note}{formmenu: name=region; US; EU}
{endnote}{if: region="US"}
You selected United States
{elseif: region = "EU"}
Tou selected Europe
{endif}

@Dan_Barak1 @scott

Thank you guys! :folded_hands: This has been resolved :clap: