htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0:
fitting size of htmlarea to the text size


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.

 


esz
Novice

Mar 4, 2003, 5:49 AM

Post #1 of 3 (2085 views)
Shortcut
fitting size of htmlarea to the text size Can't Post

I would really like to dynamically fit the htmlarea size to the actual text inside the htmlarea at any time. (specifically the height of the htmlarea)

My problem comes from the following scenario:

I have used htmlarea to make a simple Content Management system. The system uses htmlarea for wysiwyg input in predefined holes in template html pages. The problem is that with a fixed size htmlarea a page with several htmlarea's will behave very different from the final page in respect to texts that are longer than the htmlarea fixed height (scrollers in the individual htmlarea field instead of the whole page) - this is not in line with the wysiwyg idea of the content management system.

Thanks in advanced for any comments / answers / ideas Smile


Benjamin
Staff


Mar 11, 2003, 12:26 AM

Post #2 of 3 (2051 views)
Shortcut
Re: [esz] fitting size of htmlarea to the text size [In reply to] Can't Post

Hi esz,

Phew! Doozy of a problem! :-)

I think the toughest hurdle you'll run into is know how 'high' the actual content inside the htmlArea is going to be... I recently responded to a chap that was needing something similar, and I couldn't come up with anything great in his case, either.

Will the content always be text? Will it be HTML text? (Presumably! :-) How about some sort of server-side script to approximate the size / length, but running a simple size test on the number of characters in the incoming text. Then, it guesses at how much height would be required and sets the height of the htmlArea accordingly...?
Ben
interactivetools.com


skud
Novice

Jan 31, 2005, 3:11 PM

Post #3 of 3 (1782 views)
Shortcut
Re: [Benjamin] fitting size of htmlarea to the text size [In reply to] Can't Post

Hi Benjamin, I have the same request, it's easily accomplished with a regular textarea by putting this in the TEXTAREA tag:

onpropertychange="if((event.propertyName == 'value') ) this.style.height=(this.scrollHeight);"

So maybe this same sort of code could be added in editor.js ? I tried adding the onpropertychange to the TEXTAREA tag on line 231 but that had no effect (I suspect this textarea is hidden?). Also tried the same sort of thing in the IFRAME tag in line 678 (no effect).

I'm still looking, perhaps the IFRAME tag doesn't have these exact capabilities but I'm hoping there is a way that the IFRAME can be stretched or the height can be dynamic.

 
 
 


Search for (options)