Understanding formbuilder

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
cronosmachine
Forum Members
Forum Members
Posts: 23
Joined: Thu Jun 17, 2010 12:48 am

Understanding formbuilder

Post by cronosmachine »

Dear all,
Perhaps for you all will be easy to answer my question.
I have no problem creating formbuilder and show them entirely on content page using

Code: Select all

{FormBuilder form='sample_form'}
But I have problem to show them only particular field on content page.
What is the correct why to show it?
Let say if i have field name

Variable: {$name} / {$fld_80}
Field Represented: Name

Is it suppose to be like this?

Code: Select all

{FormBuilder form='sample_form' $name='default_value'}
or

Code: Select all

{FormBuilder form='sample_form' $fld_80='default_value'}
But i'm not able to show only particular name but instead all the form field was showed up.
Basically i want design my own form with text and design on content page.
I tried to look over and over on help module, but still no idea how to present only particular field.
Please correct me..

Thank you
Last edited by cronosmachine on Fri Jul 09, 2010 2:05 am, edited 1 time in total.
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: Understanding formbuilder

Post by tyman00 »

You have to build the custom form in the Form Builder interface. You use {$fld_80} inside of the form Template and then call the Form in your page content. You can't use those fields outside of the Form Builder interface.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
Peciura

Re: Understanding formbuilder

Post by Peciura »

Lets say you have to fields on your form one is named "some_text" and id of another - "80"
{cms_module module='FormBuilder' form='sample_form' value_fld80='default_value' value_some_text='another_default_value'}
Note: Smarty parameter name should not be prepended with "$".

If you want to dynamically set field names and their default value, you have to create string that looks like Smarty code and then evaluate it.
{assign var='tmp' value=80}

{capture assign='temp'}
{literal}
{cms_module module='FormBuilder' form='sample_form' value_fld{/literal}{$tmp}{literal}='default_value' value_some_text='another_default_value'}
{/literal}
{/capture}

{eval var=$temp}
or if you like
{assign var='tmp' value=80}

{capture assign='temp'}
cms_module module='FormBuilder' form='sample_form' value_fld{$tmp}='default_value' value_some_text='another_default_value'}
{/capture}

{eval var="{$temp"}
Make sure you will not add extra spaces that could break code and Smarty delimiters match when evaluating.
Last edited by Peciura on Sat Jul 10, 2010 9:21 am, edited 1 time in total.
Post Reply

Return to “Modules/Add-Ons”