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

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
deepmike
New Member
New Member
Posts: 3
Joined: Thu Jan 31, 2008 2:18 pm

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

Post 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...
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

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

Post by calguy1000 »

You don't supply information as to your call to form builder....
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
deepmike
New Member
New Member
Posts: 3
Joined: Thu Jan 31, 2008 2:18 pm

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

Post 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?
deepmike
New Member
New Member
Posts: 3
Joined: Thu Jan 31, 2008 2:18 pm

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

Post by deepmike »

Anyone?
xpatriot

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

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

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

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

Return to “Developers Discussion”