Hidden Fields in FormBuilder

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
plushtoy99
Forum Members
Forum Members
Posts: 11
Joined: Tue Jan 02, 2007 1:45 am

Hidden Fields in FormBuilder

Post 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?
climberusa
Forum Members
Forum Members
Posts: 126
Joined: Sun Feb 26, 2006 7:10 pm

Re: Hidden Fields in FormBuilder

Post 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""}
plushtoy99
Forum Members
Forum Members
Posts: 11
Joined: Tue Jan 02, 2007 1:45 am

Re: Hidden Fields in FormBuilder

Post 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?
plushtoy99
Forum Members
Forum Members
Posts: 11
Joined: Tue Jan 02, 2007 1:45 am

Re: Hidden Fields in FormBuilder

Post 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.
macfrosty

Re: Hidden Fields in FormBuilder

Post 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
Post Reply

Return to “CMSMS Core”