Missing text on saving

Last post 01-25-2006, 1:55 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  01-24-2006, 7:45 PM 15077

    Missing text on saving

    In the text window we are loosing text when saving if there are more than one paragraph returns used.
     
    We are using DOM with javascript to:
    1) copy the text window contents into a variable
    2) asynchronous save of the variable
    3) return saved result

    Looking at the HTML contents of the variable there is "<div>ampersand#160;  </div>" (note I needed to type out & to keep the information) in place of the paragraph returns.  On sending this to be saved these are lost along with any text after them.

    Any ideas what is happening and how I can easily solve it?

    Here's the relevant code:

    var editor1 = el("CE_Editor1_ID");
    myNote = editor1.getHTML();
    SaveNote(myNote, Id);

    function SaveNote(myNote, Id)
    {
     var mydate = new Date();
     clearParams();
     addParam("Id", Id);
     addParam("noteContent", myNote);
     addParam("dateTime_Modified", paramDateString(mydate));
     doAsyncCallback("Visit.SaveNote", SaveNoteSuccess, SaveNoteError);   
    }


    Thanks BS

    PS

    I've discovered that a range of other characters do the same thing (eg ", &, +, <, >).  By copying the contents of the text area into a variable I must be effecting cute editor's treatment of special characters. 
    These seem to be "character references".  Any way of easily dealing with them - other than relacing them as below - seems to work for most but not all, eg &
     
    myNote = myNote.replace(/&quot;/g, '"');
    myNote = myNote.replace(/&amp;/g, "and");
    myNote = myNote.replace(/&lt;/g, "<");
    myNote = myNote.replace(/&gt;/g, ">");   
    myNote = myNote.replace(/'/g, "'");
    myNote = myNote.replace(/ /g, "<br>");
  •  01-25-2006, 1:55 PM 15115 in reply to 15077

    Re: Missing text on saving

    BS,
     
    I am little confused about what you are trying to do.
     
    Please provide more details.
     
    I will be online tonight so please join the live support when you are online.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML