Greetings,
I am creating a CMS for a website using ckeditor as the editor for pages. I am having a problem with putting textarea's inside inside of a page. I can insert textareas, but when i want to go back to that page to edit it, the editor glitches. It thinks that that the end of the editor is at the end of the embedded text area.
For example, if i were to put...
<textarea cols='80' id='"ckeditor"' name='"ckeditor"' rows='"20"'> .....content... <textarea id="emailbody"></textarea>...content.... </textarea>
Re: Text Area Problem
Re: Text Area Problem
The main problem seems to be that, generally, browsers do not render nested textareas (a textarea inside another textarea). CKEditor passes its content to a TEXTAREA (in your example it is the TEXTAREA named "ckeditor", so placing another TEXTAREA inside the CKEditor is already creating nested TEXTAREAS..
Try to run this code in your browser and see what happens:
Re: Text Area Problem
htmlspecialchars()
on the content before sending it to the browser fixed the issue. An example would look like this:
Another important command to run if you are pulling from MySQL is stripslashes()
Hope this helps some people out!
Re: Text Area Problem
Re: Text Area Problem
When you output to the edit page ( the one with ckeditor ) you use both stripslashes() and htmlspecialchars().
This is not just an idea, I am using it in a small CMS I wrote and everything is working as it should.
Re: Text Area Problem