Hi,
i'm looking for a tip to pass an email address in the formbuilder tag.
I have one form, and it must show on multiple page, but must have another recipient according to the viewed page (so i can add a variable in the smarty field of each page, but how to pass this variable to Formbuilder tag ?).
Thanks for any idea... !
Pass an email recipient variable in formbuilder tag
Re: Pass an email recipient variable in formbuilder tag
I think you can use the fieldtype *Email Results Based on Pulldown
You could hide the field with css and set the value with javascript according to the page.
You could hide the field with css and set the value with javascript according to the page.
Re: Pass an email recipient variable in formbuilder tag
Or, and assuming you did set an alias to the field suggested by Jos, you can replace the field with
where <fieldalias> should be replaced by the alias of the field. I tend to replace all the field auto handling of the default FB template by my own HTML fields as long as I keep the name="{$actionid}{$<fieldalias>->input_id}" rule for every single field I have defined previously on FB. Also need to keep in mind that some fields handling arrays of values will surely need [] appended to the name attribute. This means that you can handle virtually any type of form with FB, be it simple or complex.
Code: Select all
<input type="hidden" name="{$actionid}{$<fieldalias>->input_id}" value=""/>"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: Pass an email recipient variable in formbuilder tag
Thanks for the tips !!
Jo : how do you replace the field? In the form template?
If i use the javascript method, will the email address be "visible" for spam bots?
Jo : how do you replace the field? In the form template?
If i use the javascript method, will the email address be "visible" for spam bots?
Re: Pass an email recipient variable in formbuilder tag
No because you define item/value pairs in the fielddefinition, and of course the item should be something else than the emailadres.Mich-adg wrote: If i use the javascript method, will the email address be "visible" for spam bots?
Re: Pass an email recipient variable in formbuilder tag
Yes. As I said:Mich-adg wrote:Jo : how do you replace the field? In the form template?
But for that you'll either trap the correct field on the foreach loop or replace all the fields which is what I do. However to be able to call the fields by alias you'll have to set them on all fields.Jo Morg wrote:I tend to replace all the field auto handling of the default FB template by my own HTML fields
As Jos just replied, and is also valid with the hidden field approach...Mich-adg wrote:If i use the javascript method, will the email address be "visible" for spam bots?
In this case you don't need javascript...Mich-adg wrote:I have one form, and it must show on multiple page, but must have another recipient according to the viewed page (so i can add a variable in the smarty field of each page, but how to pass this variable to Formbuilder tag ?).
Code: Select all
<input type="hidden" name="{$actionid}{$<fieldalias>->input_id}" value="{$MySmartyVar}"/>"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: Pass an email recipient variable in formbuilder tag
Thanks so much !




