If using a quote the editor doesn't work proper anymore
text from d base is displayed under the editor.
Even the html tags has this error.
In fck-actions.js you can change this we do so but it
didn't work.
Anyone has a solution?
text from d base is displayed under the editor.
Even the html tags has this error.
In fck-actions.js you can change this we do so but it
didn't work.
Anyone has a solution?
RE: quote problem
Example: I'll type hi how are' you. This goes to the d base. I order it back then there is hi how are the single quote is gone it is now outside the textarea and the word you is also gone.
I'll hope this explains th problem better
ans
RE: quote problem
before saving the editor content to the database I do this first:
$content = htmlspecialchars($editorcontent, ENT_QUOTES);
and when retrieving the content from the database I do this prior to loading it into the editor:
html_entity_decode($contentfromdb, ENT_QUOTES);
I hope this helps.
RE: quote problem - Help
For example:
***BEGIN ORIG TEXT**
html test
Set in the era of Led Zeppelin 8-tracks, Tab colas, and Farrah Fawcett posters, THAT '70s SHOW is a nostalgic and funny flashback to the "good ol days"
1 2
3 4
5 6
(Note - the numbers are part of a table created by the editor.)
***END ORIG TEXT**
***BEGIN EDIT TEXT**
Set in the era of Led Zeppelin 8-tracks, Tab colas, and Farrah Fawcett posters, THAT '70s SHOW is a nostalgic and funny flashback to the
***END EDIT TEXT**
What I'd like to be able to do is strip all quotes from the HTML generated by FCKEditor. Can this be done within the editor scripts? If not, I am finding it difficult to use reg exp to do this within ASP.
Any suggestions?
Thanks.
RE: quote problem - Help
RE: quote problem - Help
RE: quote problem - Help
RE: quote problem - Help
1. Submit new form using FCKEditor. No errors returned.
2. Edit document using FCKEditor. No errors returned.
3. On submit, the following error is returned:
Microsoft JET Database Engine error '80040e21'
The search key was not found in any record.
I have searched Google, and there is scant documentation out there for this error, esp. when it comes to ASP/Access.
Any ideas?
RE: quote problem - Help
If Len(documentCode) > 0 Then
If InStr(documentCode, "<") OR InStr(documentCode, ">") Then
documentCode = Replace(documentCode, chr(34), "'")
Else
documentCode = Replace(documentCode, chr(34), """)
documentCode = Replace(documentCode, vbcrlf, "<BR>")
End If
'put some line breaks in the code to avoid the db error
documentCode = Replace(documentCode, "<table", vbcrlf & "<table")
documentCode = Replace(documentCode, "<tr", vbcrlf & "<tr")
documentCode = Replace(documentCode, "<p", vbcrlf & "<p")
documentCode = Replace(documentCode, "<img", vbcrlf & "<img")
documentCode = Replace(documentCode, "<br", vbcrlf & "<br")
'Reformat the br tag
documentCode = Replace(documentCode, "<br />", "<br>")
'encode the html
Server.HTMLEncode(documentCode)
End If
Where "documentCode" = the content submitted via the editor.
RE: quote problem
<% =Server.HTMLEncode(docRS("documentCode")) %>
Hope this helps someone else having similar problems.
RE: quote problem
If you are having problems with the single quote, the best thing to do is to replace the ' with the code version of the character. I'm sure we all thought of this, the problem was actually where to place the code...
My solution to this problem was this:
your data gets entered into the fckeditor with a single quote (that is to say an apostrophe). I still haven't found the place in all of the .js files where to modify this so I did this on my own.
When you submit your form to the insert or update database code, this is when you should do your character replacement. In the area where you set your posted variables, add 2 lines in order to redefine the content coming to the database from the editor.
$content = $_POST['content'];
$tempcontent = str_replace("'", "’", $content);
//redefine content at this point//
$content = $tempcontent;
//at this point all of the singlequotes about to go into the database are redefined as ’ in stead of '
RossDog
RE: quote problem
For PHP use:
to encode: addslashes(string);
to decode: stripslashes(string);
http://www.php.net/addslashes
RE: quote problem
-------------------------------
Here is the solution I came up with from using many other text editors .... most allowed me to use jscript with "onsubmit" but because I am applying this editor to pages in ways that it was probably not intended for, this one doesn't ...
The code is in ASP but the theory is the same.
when you are either saving it to the db or taking from the db you need to do a replacement.
sample code - start
**********************
txtvalue = removeSpecialChars(txtvalue)
function removeSpecialChars(value)
if instr(1,value,vbcrlf) then
value = trim(replace(value,vbcrlf,""))
else
value = trim(value)
end if
if instr(1,value,"'") then
value = trim(replace(value,"'","'"))
else
value = trim(value)
end if
removeSpecialChars = value
end function
**********************
sample code - end
Obviously, you can add as many special chars as you want.
Hope this helps
Jael
RE: quote problem
Simple use something like this:
TextField = Replace(TextField,"'", "''")
This will replace every ' with two ''. When you insert the text into the database, the SQL will translate it to one '.
RE: quote problem
indeed leoopitz. i used:
HTTPUtility.HTMLEncode(FCKeditor1.Value)
FCKeditor1.Value = Replace(FCKeditor1.Value,"'", "’")
FCKeditor1.Value = Replace(FCKeditor1.Value,"`", "’")
'and the ` will be replaced by the html variant. Seems like htmlencode doesnt work for ' & `