Hi,
sorry for my english.. i´ll try to explain my problem:
This causes an error in JavaScript: 'unterminated string literal'. The 'value' has several linebreaks and this doesn´t work.
The first I tried was to convert all \n and \r\n to <br>. OK, editor came up, but every Submit causes additional linebreaks, so the text is unusable.
How can I solve this Problem?
Thank you very much.
best regards
Michael
sorry for my english.. i´ll try to explain my problem:
var oFCKeditor = new FCKeditor( 'besch' ) ; oFCKeditor.BasePath = "/_admin/" ; oFCKeditor.Height = 400 ; oFCKeditor.Width = 700 ; oFCKeditor.HtmlEncodeOutput = false ; oFCKeditor.FormatOutput = false ; oFCKeditor.ToolbarSet = 'Default' ; oFCKeditor.Value=' <?php echo mysql_result($rs,0,'besch'); ?>' oFCKeditor.Create();
This causes an error in JavaScript: 'unterminated string literal'. The 'value' has several linebreaks and this doesn´t work.
The first I tried was to convert all \n and \r\n to <br>. OK, editor came up, but every Submit causes additional linebreaks, so the text is unusable.
How can I solve this Problem?
Thank you very much.
best regards
Michael
Re: Atribute Value with linebreaks
I use double-quotes when embedding stuff, so I escape all double-quotes, and I substitute linefeeds (\n) with a literal '\n'. One other substitution - replace '</script>' with '<\/script>'.