Menu

#11 Javascript Error with multiple instances

v1.0_(example)
open
nobody
5
2005-06-24
2005-06-24
Anonymous
No

When more than one instance of the text area is defined
on the same form a java script error pops up. It occurs
on line 211
body = oRTE.getElementsByTagName("body");
and the error is: 'undefined' is null or not an object

I can't figure any cause for this and the area is otherwise
a very nice component (once you enable the code for
the underline button).

I would really like to know if anyone has a solution to
this problem multiple hypertext areas are really need on
one of my webforms.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    This problem shows up on the demo.html if area2 is
    uncommented.

     
  • Nobody/Anonymous

    Logged In: NO

    I have tested further and this error only seems to occur on
    Internet Explorer (and I would assume mosaic). I am using
    Explorer 6.0. I forgot my email addy in the original note. It's
    fred@mycommlog.com

     
  • Nobody/Anonymous

    Logged In: NO

    i couldnt create the control there. It seems there is a bug in the FAQ.

    i tried to modify the code, still couldnt get it work!

    function HRControl(){

    this.name = "insertHR";

    this.getRenderedText = function(){

    text = '<td><div id="insertHR">';

    text = text + '<img class="btnImage" src="'+this.area.resourcePath+'images/post_button_hr.gif" width="20" height="20" alt="Insert HR" title="Insert HR" onClick="HyperTextArea.getArea(\''+ this.area.name +'\').insertElement(doc.createElement("hr"))">';

    text = text + '</div></td>';

    return text;

    }

    }

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.