Page 1 of 1

[SOLVED] - HTML showing up in form Browser

Posted: Wed Dec 24, 2008 2:56 pm
by sagedel
Hi everyone,

I'm not sure if there is a setting for this that I am missing, or how to fix it.

I have a form set up in form builder that contains three text area fields, each of which allows the front end user to input text via tinymce wysiwyg. Once the form is submitted, it goes into the database, where I then have form browser set up to show the entries on the front end to all users of the website.

The problem is, when the browser displays the text from the wysiwyg fields, it actually prints the html tags on the page instead of using them.

Any idea on what I can do to fix this? It took me forever to get TinyMCE to work for front end users due to some bugs, so I'd really be bummed if after all that I have to take it out because its displaying the HTML.

Any help would be much appreciated.

Thanks!

Re: HTML showing up in form Browser

Posted: Wed Dec 24, 2008 3:56 pm
by sagedel
After fiddling with it some more, I don't think its Tiny because I turned off the WYSIWYG and just typed in some code and submitted.

It looks like form builder is converting the < into < on submission to the database.

Any way to fix this so that it submits the text that is actually in the box?

Re: HTML showing up in form Browser

Posted: Wed Dec 24, 2008 4:20 pm
by sagedel
Ok.. more fiddling...

I logged into my actual database through PMA... the correct HTML tags are being entered into the database properly... i.e. instead of <p<

My guess now is that its form builder doing something with the info it pulls from the database??

Re: HTML showing up in form Browser

Posted: Wed Dec 24, 2008 4:35 pm
by calguy1000
try using {$whatever|html_entity_decode}  in your formbrowser template.

Re: HTML showing up in form Browser

Posted: Wed Dec 24, 2008 4:56 pm
by sagedel
Here's my template:

Code: Select all

<p class="heading">{section name=foo start=0 loop=$count max=1}
		  {$resp->values[$smarty.section.foo.index]|escape}
		{/section}</p>
<span class="albumpicturecount2">Submitted by: {section name=foo start=6 loop=$count max=1}
		  {$resp->values[$smarty.section.foo.index]|escape}
		{/section}</span>
{if $message!=''}<p>{$message}</p>{/if}
<p><img src="{section name=foo start=1 loop=$count max=1}
		  {$resp->values[$smarty.section.foo.index]|escape}
		{/section}" width="500"></p>
{if $resp->values[$smarty.section.foo.index]|escape!=''}<p><b>Description:</b></p>
<p>{section name=foo start=2 loop=$count max=1}
		  {$resp->values[$smarty.section.foo.index]|escape}
		{/section}</p>{/if}
{if $resp->values[$smarty.section.foo.index]|escape!=''}<p><b>Cartridges Used:</b></p>
<p>{section name=foo start=3 loop=$count max=1}
		  {$resp->values[$smarty.section.foo.index]|escape}
		{/section}</p>{/if}
{if $resp->values[$smarty.section.foo.index]|escape!=''}<p><b>Instructions:</b></p>
<p>{section name=foo start=4 loop=$count max=1}
		  {$resp->values[$smarty.section.foo.index]|escape}
		{/section}</p>{/if}
Where should I put that? My knowledge of smarty and PHP does not extend much past page 2 of the manual.

Re: HTML showing up in form Browser

Posted: Wed Dec 24, 2008 4:59 pm
by sagedel
YAY! Nevermind, I got it...

I changed escape to html_entity_decode and it worked :)

Thanks so much Calguy!!!