How to stop Joomla from stripping HTML tags from form input?

This forum is for general questions about extensions for Joomla! version 1.5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
wrp103
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Aug 06, 2009 6:28 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby wrp103 » Thu Jun 03, 2010 2:23 am

I am still interested in learning the "proper" way to fix this problem, but I needed a work-around. What I did was entered HTML tags with double square brackets instead of angle brackets, and then replaced them with the correct tags.

For example:

[[p]]This is a paragraph[[/p]]

Then, in my view, I added this code:

<?php
$textin = $this->greeting;
$search = array("[[","]]");
$replace = array("<",">");
$textout = str_replace($search,$replace,$textin);
echo $textout;
?>

Which then produced:
<p>This is a paragraph</p>

Not the best solution, but at least I can now work on the actual content instead of banging my head against a wall. ;^)

aravindha
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Fri May 21, 2010 4:25 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby aravindha » Thu Jun 03, 2010 2:54 am

Were you able to check if that code works when you put in <form action> as well???

wrp103
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Aug 06, 2009 6:28 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby wrp103 » Thu Jun 03, 2010 3:02 am

I'm not using forms at this point. Basically, I have a series of articles, where each article contains links to one or more other articles.

aravindha
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Fri May 21, 2010 4:25 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby aravindha » Thu Jun 03, 2010 3:14 am

Okay, thank you. I will try it out and get back as soon as I'm done. If you have any updates/ work arounds apart from these, do post here. Thank you very much.

swimman13
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Fri Jul 10, 2009 2:23 am

Re: How to stop Joomla from stripping HTML tags from form in

Postby swimman13 » Mon Jun 07, 2010 10:27 pm

And for some reason, this just began happening on one of my sites as well, with no changes to any TinyMCE settings. After posting some 2,000 events in jEvents using the editor without any issue, now all of a sudden the form elements for our custom buttons are being stripped out. Same thing happens in JCE as well, even though all clean up options are turned off, and have been from the beginning. Even when you select no editor, it still gets stripped out. I was using 1.5.15 and have recently upgraded to 1.5.18 thinking that might help. No such luck.

- Richard

netefficacy
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Jul 27, 2010 4:08 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby netefficacy » Tue Jul 27, 2010 4:16 pm

Just thought I would add to this thread the following.

I have a custom component, Joomla 1.5.8. In the admin backend, I have a page with two instances of TinyMCE. When clicking the save button, my save method in the model was stripping the HTML from the textareas in the form POST data. The solution is to add JREQUEST_ALLOWHTML to the request method call in the save method in the model. For example:

$data = JRequest::get( 'post', JREQUEST_ALLOWHTML);

From: viewtopic.php?f=476&t=200940

aehanson
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Sun Jun 13, 2010 10:51 am

Re: How to stop Joomla from stripping HTML tags from form in

Postby aehanson » Wed Jul 28, 2010 1:32 am

This has been a long running problem but I do not see a solution... I am running V1.5.19, using JCE 1.5.7.4 and trying to insert code to enable a Picasa slide show from Google. Here is what I insert:

<embed type="application/x-shockwave-flash" src="http://picasaweb.google.com/s/c/bin/slideshow.swf" width="288" height="192" flashvars="host=picasaweb.google.com&hl=en_US&feat=flashalbum&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2FDgsWebAdmin%2Falbumid%2F5497629192116224033%3Falt%3Drss%26kind%3Dphoto%26hl%3Den_US" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>

And here is what it looks like after I save it:

<object width="288" height="192"> <param name="src" value="http://picasaweb.google.com/s/c/bin/slideshow.swf" /> <param name="contenteditable" value="inherit" /><embed type="application/x-shockwave-flash" width="288" height="192" src="http://picasaweb.google.com/s/c/bin/slideshow.swf"></embed></object>

I have tried altering the filters and other settings to no avail... help!

hnmxport
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Dec 06, 2010 8:58 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby hnmxport » Mon Dec 06, 2010 9:17 pm

I know this sounds like beating a dead horse. I have tried for hours to keep Joomla 1.5.22 from stripping the actin parameter in my paypal button.

I have changed the filter options for the article to blacklist all except super administrator and i have gone to JCE 1.5.7.6 ->control panel->configurations and set the Cleanup HTML to no
and still get the same results. All of the links that you(very very helpful) people have posted all say to do this. Can some one think of something i am missing.

User avatar
dhuelsmann
Joomla! Master
Joomla! Master
Posts: 19157
Joined: Sun Oct 02, 2005 12:50 am
Location: Omaha, NE
Contact:

Re: How to stop Joomla from stripping HTML tags from form in

Postby dhuelsmann » Mon Dec 06, 2010 10:08 pm

Did you go into JCE and change the group manager parameters to allow html? And into configuration in JCE to turn off html cleanup? And In Components/JCE Administration/Configuration there is an iframe which is set to no - if you want to use iframes then set it to yes.
Regards, Dave
Past Treasurer Open Source Matters, Inc.
http://www.kiwaniswest.org

hnmxport
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Dec 06, 2010 8:58 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby hnmxport » Tue Dec 07, 2010 3:08 pm

@ dhuelsmann you are a Joomla GOD thanks much. Did not see an option for allowing HTML in group -> edit parameters tab but i did however turn on PHP, javascript, css and XHTML( maybe thats what did the trick) anyhow it works and really appreciate it.

mdrobiul
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Thu Jan 13, 2011 8:49 am

Re: How to stop Joomla from stripping HTML tags from form in

Postby mdrobiul » Wed Jan 26, 2011 8:48 am

I'm also developing a custom admin component and when admin can enter html code. But html codes are striping automatically. How can I stop it?

I did not find any jfilter input in the mentioned location.

Kubo64
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sun Apr 03, 2011 2:48 am

Re: How to stop Joomla from stripping HTML tags from form in

Postby Kubo64 » Sun Apr 03, 2011 2:58 am

I hope this helps someone out there....I also beat my brains trying to get Tiny editor to stop stripping html... I tried everything posted in this forum also...trust me....I did some twice even! I finally decided to try a different editor and IT WORKED. I downloaded CK_Editor, (which is very nice, by the way), and it loaded my html instantly. I was trying to get my Site Lock badge image on my site and just couldn't do it, until I used CK_Editor.

Although it may sound like it....I'm not a spokes person for CK_Editor, lol, I just thought I'd share this piece of info with you all.

I am using Joomla 1.6

darbunderscore
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Jul 07, 2011 2:06 am

Re: How to stop Joomla from stripping HTML tags from form in

Postby darbunderscore » Thu Jul 07, 2011 2:34 am

Joomla 1.6.4 w/ Community Builder 1.4
I am wondering if anyone has solved the problem with the <form action> tag being stripped from within Community Builder only?
I am trying to put code for the users' paypal button on their CB Profile page using a text editor field. Even when setting my text editor to none, this code is getting stripped out. Specifically, the only part getting stripped out is the action="url" part of

Code: Select all

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

To clarify even more I can add the code to an article in Joomla, it is only in the CB component where the code is being stripped.
I've tried to add everything I can think of to the "Do not filter following tags on editor area fields:" field in CB configuration, User Profiles tab.
I've searched this and the CB forums and even posted to their forums and no love.
Any help would prevent me from knocking down this brick wall with my head. :eek: Thanks!!

bufontenator
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Dec 17, 2009 9:16 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby bufontenator » Wed Jul 20, 2011 9:30 pm

I'm now in Joomla 1.7 and was having the same problem. I installed JCE editor hoping that it would fix the problem. No luck. So I disabled the TineyMCE plugin all together and it worked. No more HTML stripping.
You can disable the plugin by going to extensions > Plugin Manager > Editor - TinyMCE > set to disabled.
It seems that even though you set a different editor as "default" it still uses settings from Tiny MCE.
Let me know if this fixes it for other people.

34Bears
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Aug 02, 2011 10:21 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby 34Bears » Mon Aug 08, 2011 2:42 am

I am using JCE too and I turned off TinyMCE and it is still striping the html. I am using Microsoft Expressions 4 to build the html and then copy, paste my custom tables. My plug in attributes are correct so I don't know what the problem is.

34Bears
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Aug 02, 2011 10:21 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby 34Bears » Mon Aug 08, 2011 3:25 am

hnmxport wrote:@ dhuelsmann you are a Joomla GOD thanks much. Did not see an option for allowing HTML in group -> edit parameters tab but i did however turn on PHP, javascript, css and XHTML( maybe thats what did the trick) anyhow it works and really appreciate it.



I tried this too. No luck!

User avatar
beneberle
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Sep 11, 2008 2:47 pm
Location: New Orleans

Re: How to stop Joomla from stripping HTML tags from form in

Postby beneberle » Fri Aug 19, 2011 6:30 pm

If there are any 1.6/1.7 component developers out there who stumble upon this thread as I did and are trying to prevent HTML from being stripped in their component's WYSIWYG editor, have a look here:

http://stackoverflow.com/questions/5782 ... -save-html

In short, you need to add filter="safehtml" to the field declaration

<field name="description" type="editor" height="250" label="Description" filter="safehtml"
description="More Info" buttons="true" />

Hope this proves useful to someone.

manos_mei
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Oct 09, 2011 12:01 am

Re: How to stop Joomla from stripping HTML tags from form in

Postby manos_mei » Sun Oct 09, 2011 12:19 am

JOOMLA 1.7
K2
JCE EDITOR 2.0.15

K2 > Items > Parameters > Content > Content Cleanup > Introtext HTML Cleaanup... set to "NO".

It works fine for me. Hope being useful :)

johnnybgoodwin
Joomla! Intern
Joomla! Intern
Posts: 59
Joined: Fri Apr 27, 2007 3:18 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby johnnybgoodwin » Tue Nov 08, 2011 9:38 pm

OK, so #1, I can't believe this issue keeps coming up again and again.... I was in a 1.7.0 site and set tiny mce to extended, no code clean up, allow iframes and scripts, etc. Anything I could see. Still strips html instantly on save.
Next with no editor, same.
Next updated to 1.7.2. Same results.
Tried JCE for the editor. Same.
tried the Codemirror editor - same.
Finally, since this is a one off edit to add mail chimp newsletter archive into an article, I just went and added thecode in mysql.
This is not a serious option, is it? For most people, or frequent use?
As for this:

"http://stackoverflow.com/questions/5782 ... -save-html

In short, you need to add filter="safehtml" to the field declaration

<field name="description" type="editor" height="250" label="Description" filter="safehtml"
description="More Info" buttons="true" />"

I appreciate when anyone tries to help, but I don't understand it!!!
There's got to be a general solution that anyone can use for this - please!

John
***** Manual signatures are NOT allowed *****
Sing all the earth

denvarel
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu May 29, 2008 9:24 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby denvarel » Fri Nov 11, 2011 2:43 pm

I have the same problem.
On joomla 1.7.2 with a jxtc template. I have a jxtc wallmodule with code straight from template jumpstart in it. When i repalced a text message from it, at save, i get a very nice, completely cleaned, code. I have tried everything, deactivate all editors, set tinymce in various ways, nothing. I cannot put any css straight in the module.
I replicate the jumpstart on another server where i tried just the plain 'save' command after i opened the module. I get clean code also as a result.
I need a solution to be able to put divs in that module.

natewlew
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Nov 14, 2011 3:08 am

Re: How to stop Joomla from stripping HTML tags from form in

Postby natewlew » Mon Nov 14, 2011 3:22 am

I also have the same problem on 1.7.2. I have disabled everything:

My Profile> Editor - None
Global Configuration> Editor - None
Plugins > Editor - TinyMCE (disabled)

When I add code to the article and save it, it changes it in a strange way:

Code: Select all

<pre xml:php>

Gets changed to:

Code: Select all

<pre />

The closing Pre tag and everything after it gets changed to:

Code: Select all

&lt;/pre&gt;

My only option is to use phpmyadmin to edit the articles.

webguydesigns
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sat Mar 20, 2010 12:27 am
Location: USA

Re: How to stop Joomla from stripping HTML tags from form in

Postby webguydesigns » Tue Nov 29, 2011 6:46 pm

The Issue in Joomlas filters

Joomla! 1.5

See this article - http://docs.joomla.org/Why_does_some_HT ... n_1.5.8%3F

Joomla! 1.7

1. In the Joomla! Article Manager, click on the Options button
2. In the Options Dialog, click on the Text Filters tab.
3. For the Super Users group, or any other trusted user group, set Filter Type to No Filtering. Make sure that you only set this option for user groups that can be trusted as setting the Filter Type to No Filtering will essentially allow the user to include any html in an article.

denvarel
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu May 29, 2008 9:24 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby denvarel » Tue Dec 06, 2011 12:24 pm

webguydesigns wrote:The Issue in Joomlas filters

Joomla! 1.5

See this article - http://docs.joomla.org/Why_does_some_HT ... n_1.5.8%3F

Joomla! 1.7

1. In the Joomla! Article Manager, click on the Options button
2. In the Options Dialog, click on the Text Filters tab.
3. For the Super Users group, or any other trusted user group, set Filter Type to No Filtering. Make sure that you only set this option for user groups that can be trusted as setting the Filter Type to No Filtering will essentially allow the user to include any html in an article.


I tried, that also. No luck! Stripping is still there . I cannot put html in module because every time i press "save" i lose formatting.
I have tried with tinymce inactive, editor none, editor jce, editor codemirror, nothing worked. Need advice asap

simonron
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Wed Apr 05, 2006 3:11 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby simonron » Thu Dec 08, 2011 11:03 am

In order to stop javascript, iframe, php code etc being stripped out - you have to do everything mentioned in this thread. Yes, everything - or at least check them. Any one of the above can and will strip contents - which is a very useful thing to have happen - as long as you know how to control it.

The final step for me ( after having found and done everything else ) is a result of a new aspect of Joomla 1.7 - at least for me. The Article Manager - options - text filter facility.
As this is part and parcel of the complex but very handy ACL system I am not surprised so many people have taken so long to find it.
It will be quite a task to fine tune this filtering system to your own requirements - but for me, enabling NO FILTERING on SuperAdmin is all I need for now. The Black Filter option kills everything no matter what editor you are using - even No Editor ! - that is what gave it away to me - and the posting just above this one MANY thanks for that :-)

This also allows the media manager from JCE to post Vimeo and [youtube] content - which was otherwise stripped despite all other settings being perfect.

Two days' work lost looking for that one.

jfelisco
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Tue Jul 05, 2011 3:01 am

Re: How to stop Joomla from stripping HTML tags from form in

Postby jfelisco » Wed Dec 21, 2011 8:57 pm

Hi there,

I have one solution. take a look with this link. It works for me.

http://docs.joomla.org/Why_does_some_HT ... n_1.5.8%3F

Good luck
Thanks,
Justin

tropikana99
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Feb 04, 2008 4:49 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby tropikana99 » Sun Jan 22, 2012 10:19 pm

add the tag that is getting stripped to the Extended Valid Elements field under Basic Options in TinyMCE and that stops it from stripping the action attribute from the form tag in the article editor or custom html modules.

I added "action" to the field after setting the filter under article options for Super User, and that took care of the problem.
You do not have the required permissions to view the files attached to this post.

sirchipmonk
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Feb 28, 2012 6:25 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby sirchipmonk » Tue Feb 28, 2012 6:31 pm

Hi all, this thread seems to have been going for some time but I hope someone out there can answer this:

i am using Breezing Forms in Joomla 1.7

Somehow the action url is being stripped from my code so the form does nothing but refresh the page.

I am not using a code editor to enter the code and I assumed Breezing forms and Joomla would work cooperatively to allow a form submission without stripping my bloody action url??

I have had success before in allowing code to be input into the joomla editors but these settings do not seem to solve the issue with Breezing Forms.

action url still being stripped.

Anyone?

Thanks

bufontenator
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Dec 17, 2009 9:16 pm

Re: How to stop Joomla from stripping HTML tags from form in

Postby bufontenator » Tue Mar 27, 2012 4:26 pm

I GOT IT!
A while ago I posted that I had a solution, it worked on one site, but not in others. So, like all of you, went looking again for a solution and I found it.
There is an extension called Sourcerer that will let you place code anywhere on the site and the html cleaner won't touch it. I've used it on several sites and it works like a charm.
http://extensions.joomla.org/extensions/edition/custom-code-in-content/5051?qh=YToxOntpOjA7czo5OiJzb3VyY2VyZXIiO30%3D
Enjoy!

I am not affiliated in any way with the extension posted in this reply.

Jarod545
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Fri May 25, 2012 10:25 am
Contact:

Re: How to stop Joomla from stripping HTML tags from form in

Postby Jarod545 » Mon May 28, 2012 6:29 pm

bufontenator wrote:I GOT IT!
A while ago I posted that I had a solution, it worked on one site, but not in others. So, like all of you, went looking again for a solution and I found it.
There is an extension called Sourcerer that will let you place code anywhere on the site and the html cleaner won't touch it. I've used it on several sites and it works like a charm.
http://extensions.joomla.org/extensions/edition/custom-code-in-content/5051?qh=YToxOntpOjA7czo5OiJzb3VyY2VyZXIiO30%3D
Enjoy!

I am not affiliated in any way with the extension posted in this reply.



i used too in one of my sites and works great for me

da8iwr
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 188
Joined: Sat Jan 14, 2006 1:59 pm
Location: Sunderland UK
Contact:

Re: How to stop Joomla from stripping HTML tags from form in

Postby da8iwr » Mon Apr 15, 2013 1:43 pm

In Joomla 1.5, 2.5 and 3.0 using JCE 154 up to the current version of 2.3 its the same way to allow this.

Go to
Components > JCE Editor > Editor Profiles > Default > Editor Parameters > Advanced

And then select "Yes" for
    Allow Javascript
    Allow CSS
    Allow PHP
    XHTML Inline Scripts

Now you can enter [youtube] Video, flash, Facebook, Twitter, etc embed code :geek:
http://www.JoomlaSiteMonitor.com
Joomla Security and backup suite.
http://www.NewWorldDesigns.co.uk
Design - CMS - Ecommerce – SEO


Return to “Extensions for Joomla! 1.5”

Who is online

Users browsing this forum: No registered users and 7 guests