Welcome Guest, Not a member yet? Register   Sign In
FCKEditor text validation and html tags problem
#1

[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
#2

[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.
#3

[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);
}




Theme © iAndrew 2016 - Forum software by © MyBB