CodeIgniter Forums
FCKEditor text validation and html tags problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: FCKEditor text validation and html tags problem (/showthread.php?tid=2247)



FCKEditor text validation and html tags problem - El Forum - 07-25-2007

[eluser]arslan ali[/eluser]
I am using FCKEditor in PHP. While validating form if an error occurs the validation class reprints contents of FCKEditor posted earlier

Code:
$this->fckeditor->Value = $this->validation->FCKEDITOR1;

but this code displays contents with extra html tags <p></p> embedded in the contents.

i have tried to remove them using strip_tags function, but can't get rid of them


Any Suggestions


FCKEditor text validation and html tags problem - El Forum - 07-25-2007

[eluser]Glen Swinfield[/eluser]
Could be because the tags aren't actually tags - they will be encoded - &gt; - &lt; etc. so strip_tags won't remove them. you may have to use html_entity_decode() somewhere. Check the php manual for full details of the function.


FCKEditor text validation and html tags problem - El Forum - 06-13-2008

[eluser]Flemming[/eluser]
I just came across the same problem - if my form fails validation, I get the contents of the FCK text area displayed with HTML entities.

The solution above from Glen fixed it! example (where 'description' is the name of the text area):

Code:
if ($this->validation->run() == FALSE) {
$this->fckeditor->Value = html_entity_decode($this->validation->description);
}