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:
Does not always work in I.E. : textarea.offsetWidth = 0 when textarea is inside a table, in I.E.


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.

 


1010011010
New User

Jul 25, 2003, 8:43 AM

Post #1 of 14 (7159 views)
Shortcut
Does not always work in I.E. : textarea.offsetWidth = 0 when textarea is inside a table, in I.E. Can't Post

HTMLArea.prototype.generate looks at the textarea's offsetWidth and offsetHeight. In I.E. 6, these values are zero if the textarea is in a table cell, resulting in the textarea simply disappearing.

I ended up doing this:

Code
// ugly hack 
if (textarea.offsetWidth == 0)
{
this._ta_size = {
w: 550,
h: 250
};
}
else
{
this._ta_size = {
w: textarea.offsetWidth,
h: textarea.offsetHeight
};
}

I hope there's a better solution than hardwiring the size for I.E.


(This post was edited by 1010011010 on Jul 25, 2003, 3:55 PM)


elainy60
New User

Aug 21, 2003, 5:30 AM

Post #2 of 14 (7081 views)
Shortcut
Re: [1010011010] Does not always work in I.E. : textarea.offsetWidth = 0 when textarea is inside a table, in I.E. [In reply to] Can't Post

Ow Maaaaaaaaaan !! Thank you so much... that was exactly what i have
been looking for... Smile
I've had Problems with this for a week now. Glad that it didn't have
to do with my code after all and that it was a bug... Cool

greetz, elainy


m8j
Novice

Aug 25, 2003, 3:40 PM

Post #3 of 14 (7068 views)
Shortcut
aaaaaaaaaaaa. finaly a solution to get htmlarea to work inside tables [In reply to] Can't Post

i just spent 4 hours to find out that htmlarea does not work on windows (also IE 5.5 !) if its inside more than one table.

shiiiiit if i knew this earlier Wink

thank you very much.


is there maybe a better solution than fixed size 550,250 for all windwos browsers ?


Mark Baker
New User

Aug 26, 2003, 4:22 AM

Post #4 of 14 (7055 views)
Shortcut
Re: [m8j] aaaaaaaaaaaa. finaly a solution to get htmlarea to work inside tables [In reply to] Can't Post

I'm not doing anything special within my scripts, but HTMLArea is running quite happily within a cell within a series of a nested tables.
---
Mark


m8j
Novice

Aug 28, 2003, 5:02 AM

Post #5 of 14 (7041 views)
Shortcut
Re: [Mark Baker] htmlarea inside tables [In reply to] Can't Post

it's no problem in any version of mozilla, but in IE 5.5 and IE 6 the editable area disappears (toolbar remains) due to the described IE bug.

it's easy to reproduce, just take the example.html page included with htmlarea and place another <table><tr><td> </td></tr></table> around the textarea.


norma
Novice

Aug 30, 2003, 9:34 AM

Post #6 of 14 (7020 views)
Shortcut
Re: [m8j] htmlarea inside tables [In reply to] Can't Post

A simple but effective workaround: place an iframe into the cell where htmlArea should appear. The iframe loads the desired page...


Code
  <table border="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#8E8E8E" width="537" cellpadding="0" id="t1">   
<tr>
<td>
<p align="center">&nbsp;</td>
</tr>
<tr>
<td align="center">
<iframe name="I1" width="538" height="320" marginwidth="1" marginheight="1"
scrolling="no" align="middle" border="0" frameborder="0" src="htmlarea.htm">
hint...</iframe>
</td>
</tr>
<tr>
<td></td>
</tr>
</table>




you can see a demo here: http://home.arcor.de/nor_ma/htmlarea/


(This post was edited by norma on Aug 30, 2003, 9:41 AM)


rickroot
Novice

Sep 10, 2003, 7:31 AM

Post #7 of 14 (6956 views)
Shortcut
Re: [1010011010] Does not always work in I.E. : textarea.offsetWidth = 0 when textarea is inside a table, in I.E. [In reply to] Can't Post

I was directed to this thread by someone else.

I have an htmlarea that is generated within several levels of nested tables. This worked great in Mozilla, but the content area disappeared in Internet Explorer.

After several hours of frustration as to why my textarea was disappearing, I finally solved the problem.

I had to put my javascript code OUTSIDE of the table constructs. The code in question was:

<script type="text/javascript">
initEditor();
</script>

I put this at the very end of the document, and all is well now.

- Rick Root


hugues
New User

Mar 5, 2004, 8:33 AM

Post #8 of 14 (6346 views)
Shortcut
Re: [1010011010] Does not always work in I.E. : textarea.offsetWidth = 0 when textarea is inside a table, in I.E. [In reply to] Can't Post

Does something similar to the hack provided will be eventually implemented in HtmlArea 3 ? On the application I'm currently working, I don't have the possibilityto call the initEditor() outside the <table> tag.

Regards


Daiz13
Novice

Mar 18, 2004, 11:17 AM

Post #9 of 14 (6231 views)
Shortcut
Re: [1010011010] Does not always work in I.E. : textarea.offsetWidth = 0 when textarea is inside a table, in I.E. [In reply to] Can't Post

I have simillar problem:
http://www.interactivetools.com/iforum/Open_Source_C3/htmlArea_v3.0_-_Beta_Release_F14/Horizontal_scrollbar_in_IE_when_document_contains_table_P25514/

Solution with offsetWidth doesn't work's for me Unsure
My textarea is contained in several nested tables, and it doesn't take into account width of other columns of the table, so my offsetLeft=0 and offsetWidth is 1172 (screen.width=1024).
I had to make changes like this:

Code
    if (textarea.offsetWidth > screen.width) 
{
this._ta_size = {
w: screen.width-270,
h: textarea.offsetHeight
};
}
else
{
this._ta_size = {
w: textarea.offsetWidth,
h: textarea.offsetHeight
};
}



phirschybar
Novice

Oct 6, 2004, 2:27 PM

Post #10 of 14 (5498 views)
Shortcut
Re: [Daiz13] Does not always work in I.E. : textarea.offsetWidth = 0 when textarea is inside a table, in I.E. [In reply to] Can't Post

nahhh.. this'll do.. thanks!!


jkon
New User

Oct 14, 2004, 2:11 PM

Post #11 of 14 (5420 views)
Shortcut
Re: [phirschybar] Does not always work in I.E. : textarea.offsetWidth = 0 when textarea is inside a table, in I.E. [In reply to] Can't Post

I try to open the HTMLArea with a text already inside the textarea. With Firefox it works great, but in IE 6.0 the contents blinks shortly up, just to vanish then. It actually looks like if the page were reloading.

I tried everything, with Version rc1, and current CVS snapshots. And I tried in all versions both of the above hacks, but i still can't get it to work with IE 6.0


frets
Novice

Oct 19, 2004, 7:07 PM

Post #12 of 14 (5355 views)
Shortcut
Re: [Daiz13] Does not always work in I.E. : textarea.offsetWidth = 0 when textarea is inside a table, in I.E. [In reply to] Can't Post

Daiz13's solution didn't work for me... I'm using IE6 and working with htmlarea in nested tables.

Is there any other solution on the problem?


kenzor
New User

Oct 20, 2004, 12:41 AM

Post #13 of 14 (5351 views)
Shortcut
Re: [frets] Does not always work in I.E. : textarea.offsetWidth = 0 when textarea is inside a table, in I.E. [In reply to] Can't Post

htmlArea was causing a few problems with layout under Internet Explorer for me. My problem was solved by changing this line:


Code
iframe.style.width = width + "px";


with this:


Code
iframe.style.width = "100%";


in htmlarea.js, line 706, in HTMLArea.prototype.generate()

I also had htmlarea being displayed in a table with class "form". In my css I had the following:


Code
TABLE.form TD { padding: 3px; }


which meants every TD within the table (including those within htmlarea was getting 3px padding.

This needs to be replaced with:


Code
TABLE.form > TR > TD { padding: 3px; }


or something similar but thanks to M$, IE doesn't actually support this (or most of the CSS standard for that matter).


frets
Novice

Oct 20, 2004, 6:08 AM

Post #14 of 14 (5344 views)
Shortcut
Re: [kenzor] Does not always work in I.E. : textarea.offsetWidth = 0 when textarea is inside a table, in I.E. [In reply to] Can't Post

Changing the iframe.style.width seems to have solved the problem.

Thanks

 
 
 


Search for (options)