Hide option content placed by dropdown menu

Hello All

When using the snippet below, is using a note the best way to hide the contents of the options from the dropdown menu?

{note}{formmenu: default=Choice A; Choice B; Choice C; name=Many Choices\ }{endnote}
{if: `Many Choices ` = "Choice A"; trim=right}
When the menu selection is "Choice A", this will show.
{elseif: `Many Choices ` = "Choice B"; trim=yes}
When the menu selection is "Choice B", this will show.
{elseif: `Many Choices ` = "Choice C"; trim=yes}
When the menu selection is "Choice C", this will show.
{endif: trim=left}

I don't want

Choice AWhen the menu selection is "Choice A", this will show.

I do want

When the menu selection is "Choice A", this will show.

Hi @Richie_Schut ,
Welcome to the Text Blaze community.
Yes {note} is the best way to hide the contents.
You snippet looks perfect for me. Are you observing any issue with this?

In your snippet, if you need dont want the additional first line, you can move the {endnote} tag to the next line.

Something like

{note}{formmenu: default=Choice A; Choice B; Choice C; name=Many Choices\ }
{endnote}{if: `Many Choices ` = "Choice A"; trim=right}
When the menu selection is "Choice A", this will show.
{elseif: `Many Choices ` = "Choice B"; trim=yes}
When the menu selection is "Choice B", this will show.
{elseif: `Many Choices ` = "Choice C"; trim=yes}
When the menu selection is "Choice C", this will show.
{endif: trim=left}

Hi @Richie_Schut,

Just want to add something to Vinod's reply.

Whenever I use command blocks (commands with an opening and closing part), I always use trim=right to control how they show up. This obviously includes note blocks.

Here's how I would do it using your snippet as an example:

{note: trim=right}
{formmenu: default=Choice A; Choice B; Choice C; name=Many Choices\ }

{endnote: trim=right}
{if: `Many Choices ` = "Choice A"; trim=right}
When the menu selection is "Choice A", this will show.

{elseif: `Many Choices ` = "Choice B"; trim=yes}
When the menu selection is "Choice B", this will show.

{elseif: `Many Choices ` = "Choice C"; trim=yes}
When the menu selection is "Choice C", this will show.

{endif: trim=right}

Notice how the preview is much cleaner when you use this approach, because you can add spaces after your commands without affecting the output of the snippet.

Hope this helps :slight_smile:

2 Likes