Page 1 of 1

What is the correct syntax to use smart tags in Form Builder 'hidden' field?

Posted: Thu Jan 31, 2008 2:31 pm
by deepmike
This is driving me a bit crazy....

Am using Form Builder to create a form (logically), and I want the form (that is sent to the site administrator) to have a reference to the page (and/or contents of the page) that the user sends the form from.

This would 'appear' to be possible using the 'Hidden' field in Form Builder - which allows smarty's to be processed.
I hence input the smarty value - typically {$title} - which shows up nicely in the body of the page - but when the Form Builder part is processed it gives this error:

string(127) "Smarty error: [in evaluated template line 1]: syntax error: unrecognized tag: $title (Smarty_Compiler.class.php, line 446)" string(117) "Smarty error: [in evaluated template line 1]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"

Implying I have the incorrect syntax. ('Process smarty tags within field' is selected)
So how should it be done????

Or how else can something similar be achieved - ideally using Form Builder which has the functionality I'm looking for.

Hope someone knows the answer...

Re: What is the correct syntax to use smart tags in Form Builder 'hidden' field?

Posted: Thu Jan 31, 2008 3:03 pm
by calguy1000
You don't supply information as to your call to form builder....

Re: What is the correct syntax to use smart tags in Form Builder 'hidden' field?

Posted: Thu Jan 31, 2008 3:06 pm
by deepmike
Called using: {cms_module module='FormBuilder' form='sample_form'}

'sample_form' has then been modified to have this hidden field with smarty.
Does that help?

Re: What is the correct syntax to use smart tags in Form Builder 'hidden' field?

Posted: Thu Jan 31, 2008 8:40 pm
by deepmike
Anyone?

Re: What is the correct syntax to use smart tags in Form Builder 'hidden' field?

Posted: Fri May 09, 2008 9:51 am
by xpatriot
If you use the {title} tag instead of using {$title} it should work.

However I couldn't get it to work with {$customcontent_loginname} (I got the same "unrecognized tag" error message)

Got the required result by :
- creating a hidden value
- leave the value field empty
- in the tag calling the form I gave a default value to the hidden field (this is in the help file)
  for example : {cms_module module='FormBuilder' form='my_form' value_fld29=$customcontent_loginname}
                or : {cms_module module='FormBuilder' form='my_form' value_my_hidden_field=$customcontent_loginname}

IMPORTANT It says in the help file that inline display is not supported so you must not select 'Display form inline?'
For example : with a Store Results in Database field in the form, inline display selected  and a default value in the call to Form Builder there is the following error:
Warning: htmlspecialchars() expects parameter 1 to be string, array given in
..../modules/FormBuilder/action.default.php on line 120

Re: What is the correct syntax to use smart tags in Form Builder 'hidden' field?

Posted: Thu Jul 31, 2008 12:56 pm
by liudaz
Did anybody get so solve this issue? I am getting the same... the return value (received result as email) i get "Array" for the hidden field.