Good morning,
I would like to know if there was a possibility to dynamically add text field buttons
What I would like is a button that allows you to add a text field and then asks you to add another, then another, then another etc... No limit as long as the button is checked Everytime.
A bit like this but dynamically, like a loop, knowing that each button and text field has a different tag:
{formtoggle: name=Toggle Field 0}{formtext: name=Text Field 0} add more ? : {formtoggle: name=Text Field +1; default=no}{formtext: name=Text Field 1}add more ? : {formtoggle: name=Text Field +2; default=no}{formtext: name=Text Field 2}add more ? : .....{endformtoggle}{endformtoggle}{endformtoggle}
For the moment we don't have exactly what you want, but you could try something like this:
{note}Field count: {formmenu: 1;2;3;4;5;6; name=fields}{endnote}
{repeat: for i in seq(1, fields)}
Text field {=i}: {formtext}
{endrepeat}
Also keep your eyes out for our monthly update coming up next month. I don't want to spoil the surprise (and I can't 100% promise it), but we might have something pretty amazing in store related to what you're asking about.
I gave the formtext a name (so it can be used as a variable).
It automatically gets a value so the first one is hello[1].formtext, next one will be hello[2].formtext
and so on.
I show it as a repeat command here - try to fill out a couple of textboxes to see how it works.
{endif}{endrepeat}
{endnote}
{repeat: for x in countsub}Id: {=x.id}
The price is: {if: countsub[location(countsub, x)].choice = "TBD"}€{=countsub[location(countsub, x)]["tbd_value"]}{else}{=x.choice}{endif}
{endrepeat}The total price is €{=sum(map(countsub, x -> extractregex(x.choice & x.tbd_value, "\d+")))}