htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Bug Reports & Fixes:
Losing Text entered in WYSIWYG


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


reg
Novice

Jan 24, 2005, 11:40 AM

Post #1 of 9 (9180 views)
Shortcut
Losing Text entered in WYSIWYG Can't Post

Don't know if this is a bug or something I am doing wrong... but any text entered into wysiwyg mode is lost when the form is submited/posted unless the htmlarea control has been toggled into source mode first. Again, don't know if it should make any difference but I have several htmlareas on the same form, running in IE6, SP2

Is this happening to everyone or is it just my set-up ... or worse, is it by design?

Thanks

Reg


tholdy
Novice

Jan 24, 2005, 12:51 PM

Post #2 of 9 (9171 views)
Shortcut
Re: [reg] Losing Text entered in WYSIWYG [In reply to] Can't Post

I had the same problem but found a solution. I have absolutely no idea why it works.

I found this submit script in an example:

Code
<script type="text/javascript"> 
function mySubmit() {
document.edit.onsubmit(); // workaround browser bugs.
document.edit.submit();
};
</script>

("edit" is the id of the form)
then I changed the submit-button from:


Code
<input type="submit" value="send">

to:

Code
<input type="button" value="send" onclick="mySubmit();">



(This post was edited by tholdy on Jan 24, 2005, 12:52 PM)


reg
Novice

Jan 24, 2005, 1:01 PM

Post #3 of 9 (9166 views)
Shortcut
Re: [tholdy] Losing Text entered in WYSIWYG [In reply to] Can't Post

Hi Tholdy,

I guess if this works it is worth trying; I wonder if we are the only ones having this problem and if so, why.

Thanks,

Reg


(This post was edited by reg on Jan 24, 2005, 1:43 PM)


reg
Novice

Jan 24, 2005, 1:44 PM

Post #4 of 9 (9160 views)
Shortcut
Re: [tholdy] Losing Text entered in WYSIWYG [In reply to] Can't Post

Yes Tholdy,

this works; thanks very much

Reg


reg
Novice

Jan 25, 2005, 2:26 PM

Post #5 of 9 (9111 views)
Shortcut
Re: [tholdy] Losing Text entered in WYSIWYG [In reply to] Can't Post

Hi again,

now I am getting some grief in other areas because of this change. The error is

"Object doesn't support this property or method"

The offending line is in line 113 (so somewhere in the function)

112: function mySubmit()
113: {
114: document.fullpage.onsubmit(); // workaround browser bugs.
115: document.fullpage.submit();
116: };
117: </script>


the form on this page is called fullpage and other pages with a similarly named form and containing this code work just fine.

the only difference I can see is that the pages that work have an instance of htmlarea and the ones that don't do not -- but the form definition is the same. And I don't know enough javascript to figure this out.

Any suggestions?

Thanks

Reg


tholdy
Novice

Jan 27, 2005, 4:30 AM

Post #6 of 9 (9079 views)
Shortcut
Re: [reg] Losing Text entered in WYSIWYG [In reply to] Can't Post

I think the onsubmit(); function is defined by htmlarea. I found out that it is a function that puts the text from the wysiwyg-editor into the textarea. So it should only be used when submitting a wysiwyg-textarea.


reg
Novice

Jan 27, 2005, 6:57 AM

Post #7 of 9 (9072 views)
Shortcut
Re: [tholdy] Losing Text entered in WYSIWYG [In reply to] Can't Post

Hi Tholdy,

thanks for the reply. My work-around was to put an "onsubmit( return 'true')" in every form definition that might have htmlarea in it (my pages are generated dynamically from meta-data and it isn't always easy to look ahead). This seems to work -- so now I can focus on other isues with this great product (I hope)

Reg


Sarpedon
New User

Jan 30, 2005, 9:55 AM

Post #8 of 9 (9005 views)
Shortcut
Re: [tholdy] Losing Text entered in WYSIWYG [In reply to] Can't Post

I tried that as a possible workaround regarding how the value="button text here" gets dropped from <input type="submit" value="button text" etc...> making all the submit button be Submit Query.

So I changed this:
<input type="submit" name="B1" /> </p><p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><a href="index.html"><span style="FONT-SIZE: 8pt">Click here for last week's results</span></a></p></td></tr></tbody></table>

To this:
<input type="button" value="send" onclick="mySubmit();"></p><p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><a href="index.html"><span style="FONT-SIZE: 8pt">Click here for last week's results</span></a></p></td></tr></tbody></table>

But then, after switching to Wysiwyg mode and back to Text Mode, that became this garbage:

<input onclick="function anonymous()
{
mySubmit();
}" type="button" /></p><p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><a href="index.html"><span style="FONT-SIZE: 8pt">Click here for last week's results</span></a></p></td></tr></tbody></table>

so instead of being stuck with Submit Query as the button I got a button that seemed a couple of spaces wide and said nothing at all. So back to Submit Query for now.

Not using the latest beta version though, had problems with it.


super_j
New User

Feb 9, 2005, 10:59 AM

Post #9 of 9 (8786 views)
Shortcut
Re: [reg] Losing Text entered in WYSIWYG [In reply to] Can't Post

I had the same issue. Here is a fix I created that seems to work pretty well. It periodically updates the textarea with the text.

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

setTimeout("updateText()", 1000);


 
 
 


Search for (options)