Page 1 of 1
Hidden Fields in FormBuilder
Posted: Sun Sep 30, 2007 4:10 pm
by plushtoy99
Hi There,
Trying to pass a variable from the Calendar module 0.7.7 to FormBuilder 0.3 like this:
{cms_module module='FormBuilder' form='register' value_classTitle=$event.event_title}
Then I added a hidden field to my FormBuilder register form with the value of classTitle.
The variable is not being passed. The email reads: hidden: classTitle
Can anyone tellme what I am doing wrong?
Re: Hidden Fields in FormBuilder
Posted: Sun Sep 30, 2007 4:20 pm
by climberusa
Where are you calling the formbuilder module from? I am passing the date variable from calendar into a hidden field but i am doing it from within the calendar module 'event template' and it works perfectly.
Code: Select all
{cms_module module='FormBuilder' form='telreg' value_Date=$event.event_date_start|date_format:"%B %d, %Y at %I:%M%p""}
Re: Hidden Fields in FormBuilder
Posted: Sun Sep 30, 2007 4:27 pm
by plushtoy99
I am calling it from a detail page.
{cms_module module='FormBuilder' form='register' value_classTitle=$event.event_title}
This is calling the FormBuilder module but not passing the variable.
How are you adding it to the Event Template within Calendar?
Re: Hidden Fields in FormBuilder
Posted: Sun Sep 30, 2007 6:15 pm
by plushtoy99
Added {cms_module module='FormBuilder' form='register' value_classTitle=$event.event_title} to the event template within Calendar module and added a hidden field to the form (classTitle) but the variable is not passing. Still getting just the tag {classTitle} in the email.
Re: Hidden Fields in FormBuilder
Posted: Sat Dec 29, 2007 10:47 am
by macfrosty
plushtoy99 wrote:
Added {cms_module module='FormBuilder' form='register' value_classTitle=$event.event_title} to the event template within Calendar module and added a hidden field to the form (classTitle) but the variable is not passing. Still getting just the tag {classTitle} in the email.
Here is my solution as found this
post on the forum by calguy1000.
paste this snippet into your Calendar Event template:
Code: Select all
{assign var=value_classTitle value=$event.event_title}
{cms_module module='FormBuilder' form='register' value_classTitle=$event.event_title}
This will pass the title of the event to your formular. You can assign more values to your formular by adding more variables to the template, here is a list of variables, there are probably more but this is what I found most usefull:
Code: Select all
{assign var=value_classStart value=$event.event_date_start}
{assign var=value_classEnd value=$event.event_date_end}
{assign var=value_classTitle value=$event.event_title}
{assign var=value_classSummary value=$event.event_summary}
{assign var=value_classDetails value=$event.event_details}
When adding more variables to the template, be sure to add them to the formular like this:
{cms_module module='FormBuilder' form='register' value_classTitle=$event.event_title
value_classStart=$event.event_date_start}
Only seperate the variables by a single space.
This takes care of the Event Template, now for actually using the variables in the formular, go to FormBuilder module and add to your formular the hidden fields needed. Be sure to name them exactly as the variables called, eg. value_classTitle get named classTitle and so and so forth. Now the variables are available as smarty and can be called in the Formular templates as {classtitle} .... I'm pretty sure that smarty tags is all small letters, its not {classTitle} but {classtitle} .
Hope this helps.... it worked for me
Greets, Morten