Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-03-15 00:26:11

yummycarp
New member
Registered: 2005-03-15
Posts: 3

Losing data when saving.

This is a problem from htmlarea 2 and 3 but I would call kindof rare.    I have a number of clients that have lost their data but I cannot reproduce the problem.  I think it may be that the page has not entirely loaded like maybe waiting on a button gif, and if the Save button is pressed to save the page via my php script, the variables for the htmlarea must be reading empty and therefore saved as empty. 

I found a function in the old htmlarea forum but do not understand how to implement it.  Someone posted...

function updateText()   

    if ( typeof ( editor ) != "undefined" )   
    {   
        if ( typeof ( editor._doc ) != "undefined" ) 
        { 
            mode = ((editor._editMode == "textmode") ? "wysiwyg" : "textmode");   
            switch(mode)
            {   
                case "textmode":   editor._textArea.value = editor.getHTML();   break;   
            } 
        } 
    }   setTimeout("updateText()", 1000);   
}   setTimeout("updateText()", 2000);


Any ideas or help on this problem and how to fix it.  I think if I can "know for sure" that the data is loaded in the textarea boxes (I have multiple) then I can enable the save button... but I don't know how to tell if that is the case.

Thanks.

Last edited by yummycarp (2005-03-15 00:27:11)

Offline

#2 2005-03-15 02:59:19

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: Losing data when saving.

using such a updateText-function is imho ugly.

how do you submit the form? do you have a real submit-button or do you have a javascript link?


Niko

Offline

#3 2005-03-15 17:51:02

yummycarp
New member
Registered: 2005-03-15
Posts: 3

Re: Losing data when saving.

I have a real submit button.   Is my logic sound or is it not possible to press my save button and the textareas to return empty content  to the update statement.  It just looks like on the rare occation that is what happens.  Then I found other people talking about similar behaviour and this function suggested other people had this problem. 

Anything I can call or do in the Submit validation function to ensure that the textareas are ready to return all their content ?  I guess I could check if all three are empty, don't allow the save try again.  Sounds better to be able to call a function in editor.js to verify things though.

Thanks.

Offline

Board footer

Powered by FluxBB