Hi
The problem is that when the content contains a linebreak (<br />) the textarea is not converted into an CKEditor. So the CKEditor will not be visible. Below you see my source code
<textarea id="editor1" name="editor1"></textarea>
<script type="text/javascript">
CKEDITOR.replace( 'editor1');
var whatever = "vinter<br />sommer";
CKEDITOR.instances.editor1.setData( whatever );
</script>
I've also modified the config.js file, because the same problem occur with <p>
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.enterMode = 2
};
Hope some of you might have som suggestions for me
The problem is that when the content contains a linebreak (<br />) the textarea is not converted into an CKEditor. So the CKEditor will not be visible. Below you see my source code
<textarea id="editor1" name="editor1"></textarea>
<script type="text/javascript">
CKEDITOR.replace( 'editor1');
var whatever = "vinter<br />sommer";
CKEDITOR.instances.editor1.setData( whatever );
</script>
I've also modified the config.js file, because the same problem occur with <p>
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.enterMode = 2
};
Hope some of you might have som suggestions for me
Re: CKEditor will not load when content has <br />
However, you can try
and see if it does any better.
Re: CKEditor will not load when content has <br />
"vinter<br />sommer"; works well, but the text I really should have used is:
"vinter<br />
sommer";
The point is the I in CKEditor written:
vinter
sommer
and then saved the database. When I load the page (and execute the javascript) the html markup for the text becomes :
"vinter<br />
sommer";
I use this php code to put the database value into the variable:
var whatever = "<?= $value ?>";
I'm not sure if the problem is in th script here or in the way I send the content of editor1 into the database. To get the value of the editor1 I only use this php code $_POST['editor1']
I think the error is related to the thing that the text becomes on twoo lines and there is no concatinations between the lines and it makes the entire javascript not running. I'm not sure how to resolve it.
Hope you have some suggestions for me
Re: CKEditor will not load when content has <br />
<textarea id="editor1" name="editor1"><?= $value ?></textarea>