Nesting Text Options in Forms

Hi,

Is there anyway I can get a form option, when selected, to then allow me to input extra data.

Example:

{formmenu:name=options;
<<Opt 1>> Please find attached your proof ;
<<Opt 2>> Please find attached your amended proof ;
<<Opt 3>> Please find attached your amended proof for job number: (ALLOW TEXT INPUT OF NUMBER HERE);
<<Opt 4>> Please find attached your requested artwork;}

So if Opt 1 is selected from the form then the output would be:
Please find attached your proof

But, if Opt3 is selected from the form then the output would be:
Please find attached your amended proof for job number: (THE NUMBER I WANT TO TYPE IN WHEN THIS OPTION IS SELECTED ONLY)

I hope this makes sense.

Many thanks :slight_smile:

@Paul_Williams - I think you're looking for something like this:

{note: preview=no}
{options=["<<Opt 1>> Please find attached your proof",
"<<Opt 2>> Please find attached your amended proof",
"<<Opt 3>> Please find attached your amended proof for job number:",
"<<Opt 4>> Please find attached your requested artwork"]}

{endnote: trim=right}

{formmenu:name=choice; cols=50; values={=options}} {if: choice=="<<Opt 3>> Please find attached your amended proof for job number:"}{formtext: cols=10}{endif}

Alternatively:

{note}
Job number: {formtext: name=jobnumber}

{endnote: trim=right}
{note: preview=no}
{options=["<<Opt 1>> Please find attached your proof",
"<<Opt 2>> Please find attached your amended proof",
"<<Opt 3>> Please find attached your amended proof for job number:"&jobnumber,
"<<Opt 4>> Please find attached your requested artwork"]}

{endnote: trim=right}

{formmenu:name=choice; cols=80; values={=options}}

But I think the first option is moore practical.

In the version using an if condition, you also use the startswith function to only match with a small prefix of the option text (assuming the suffix parts of it may change in the future)

{note: preview=no}
{options=["<<Opt 1>> Please find attached your proof",
"<<Opt 2>> Please find attached your amended proof",
"<<Opt 3>> Please find attached your amended proof for job number:",
"<<Opt 4>> Please find attached your requested artwork"]}
{endnote: trim=right}

{formmenu: name=choice; cols=50; values={=options}} {if: startswith(choice, "<<Opt 3>>")}{formtext: cols=10}{endif}

1 Like

@Paul_Williams - riffing on Gaurang's suggestion in case you're not using the suffixes, you could do something like this to trigger the {if} command when the choice contains the term "job search".

{note: preview=no}
{options=["<<Opt 1>> Please find attached your proof",
"<<Opt 2>> Please find attached your amended proof",
"<<Opt 3>> Please find attached your amended proof for job number:",
"<<Opt 4>> Please find attached your requested artwork"]}
{endnote: trim=right}

{formmenu: name=choice; cols=50; values={=options}} {if: contains(choice, "job number")}{formtext: cols=10}{endif}

I had actually never thought of approaching it this way. Thanks for triggering the idea @Gaurang_Tandon.

2 Likes

Many thanks for this Gaurang :slight_smile:

And thanks for this solution too Cedric :slight_smile:

Now what if I wanted a choice of when this triggered,

For example: Contains 'job number' OR contains 'requested'

Many thanks :slight_smile:

@Paul_Williams - Here you go :slight_smile:

{note: preview=no}
{options=["<<Opt 1>> Please find attached your proof",
"<<Opt 2>> Please find attached your amended proof",
"<<Opt 3>> Please find attached your amended proof for job number:",
"<<Opt 4>> Please find attached your requested artwork"]}
{endnote: trim=right}

{formmenu: name=choice; cols=50; values={=options}} {if: contains(choice, "job number") OR contains(choice, "requested")}{formtext: cols=10}{endif}

Thanks Cedric,

I wasn't sure how the OR command was used in Text Blaze of even if was at all.

Many thanks again :slight_smile:

1 Like