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 - Discussion:
retrieve HTMLArea content


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.

 


zamelo
Novice

Jan 13, 2005, 7:44 AM

Post #1 of 9 (3696 views)
Shortcut
retrieve HTMLArea content Can't Post

Hi,

Having trouble retrieving the content from my htmlArea correctly.

I am using this code currently:

document.newTemplate.tmplt_content.value = editor.getInnerHTML("tmplt_content");

Seems to work in Firefox but in IE the code gets all messed up.

What is the correct way of retrieving the content from htmlArea to save to a form field for submission?




sleemanj
User

Jan 13, 2005, 4:41 PM

Post #2 of 9 (3663 views)
Shortcut
Re: [zamelo] retrieve HTMLArea content [In reply to] Can't Post

HTMLArea will automatically save the HTML back into the textarea you replace.

However if you do need to get the HTML out yourself, you can use editor.getHTML()


James Sleeman
PHP Programmer


zamelo
Novice

Jan 13, 2005, 11:06 PM

Post #3 of 9 (3654 views)
Shortcut
Re: [sleemanj] retrieve HTMLArea content [In reply to] Can't Post

Thanks for your reply.

I am aware of this but it only works when using a submit button and I am using a Javascript submit.

Whether I use getHTML and getInnerHTML. I have a template with divs and instead of saving the code as is displayed in the area (after uploading my html template) it really messes up the code badly.

I need to retrieve the html without htmlArea messing up the original code.


sleemanj
User

Jan 13, 2005, 11:53 PM

Post #4 of 9 (3648 views)
Shortcut
Re: [zamelo] retrieve HTMLArea content [In reply to] Can't Post

Define "messes up". Can you post a before & after sample please.

Does it get messed up when switching to "code view" as well?


James Sleeman
PHP Programmer


zamelo
Novice

Jan 14, 2005, 12:07 AM

Post #5 of 9 (3644 views)
Shortcut
Re: [sleemanj] retrieve HTMLArea content [In reply to] Can't Post

Thanks for your concern sleemanj

I have upload before and after files.

In IE the code seems to be changed (messed up) when switching to text mode or when submitting.

In Firefox, switching to text mode seems to change the code but it works fine otherwise.

My main concern is IE.

Thanks for your time.
Attachments: before.html (31.5 KB)
  after.html (31.6 KB)


sleemanj
User

Jan 14, 2005, 2:34 AM

Post #6 of 9 (3630 views)
Shortcut
Re: [zamelo] retrieve HTMLArea content [In reply to] Can't Post

The problem is inherint in the way the web browsers work. When switching to text mode, or 'saving' the html the HTML is re-generated from the DOM (Document Object Model) tree, the original source-formatting is discarded.

Inevitably the source code formatting when it comes out will be different to how it went in. I believe that IE places it all on one line by default (newlines are irrelevant in XML & HTML).

The main difference (apart from whitespace) in the after shot is that many of the attributes do not have surrounding quotes, this may be the crux of your problem and it's on my list to have a look at that.


James Sleeman
PHP Programmer


zamelo
Novice

Jan 14, 2005, 5:39 AM

Post #7 of 9 (3609 views)
Shortcut
Re: [sleemanj] retrieve HTMLArea content [In reply to] Can't Post

Hey sleemanj

Well thanks for your replies.

Would it be fair to ask when this will be fixed? I would really like to include this in my project but if it breaks everytime someone uploads a template with lots of js, divs etc it might break alot Frown


sleemanj
User

Jan 14, 2005, 6:51 AM

Post #8 of 9 (3604 views)
Shortcut
Re: [zamelo] retrieve HTMLArea content [In reply to] Can't Post


In Reply To
Would it be fair to ask when this will be fixed? I would really like to include this in my project but if it breaks everytime someone uploads a template with lots of js, divs etc it might break alot Frown


Please note I am not currently in any way connected to or developing for the official htmlArea.

Its on the list for looking at in my fork, this coming week sometime (that is, the non-quoted attributes, I can't do anything about indentation/whitespace etc you'd have to talk to Microsoft and Mozilla about that).

Also note, that if you are trying to input javascript in the editor, well, good luck with that.


James Sleeman
PHP Programmer


zamelo
Novice

Jan 14, 2005, 6:54 AM

Post #9 of 9 (3601 views)
Shortcut
Re: [sleemanj] retrieve HTMLArea content [In reply to] Can't Post

thanks again

 
 
 


Search for (options)