PDA

View Full Version : HTMLArea with mulitple textareas



brooksh
09-26-2004, 02:42 PM
HTML area 3 works great with IE and Firefox. The problem I am running into is that if you have 2 or more different textarea's, then it quits working in IE but will still work in Firefox. I have put the code into main.php where it says textarea. I have the script saying:



<style type="text/css">
/*<![CDATA[*/
<!--
.textarea { height: 30em; width: 80%; }
-->
/*]]>*/
</style>
<script type="text/javascript">
//<![CDATA[
_editor_url = "htmlarea/";
_editor_lang = "en";
//]]>
</script><!-- load the main HTMLArea file -->
<script type="text/javascript" src="htmlarea/htmlarea.js">
</script>
<script type="text/javascript">
//<![CDATA[
HTMLArea.loadPlugin("ImageManager");
initdocument = function () {
var editor = new HTMLArea("<?php echo "$field_name"; ?>");
editor.generate();
}
function addEvent(obj, evType, fn)
{
if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
else { return false; }
}
addEvent(window, 'load', initdocument);
//]]>
</script>
<FONT face=Arial size=2><FONT face=Arial size=2>
<?php
echo "<textarea id=\"$field_name\" class=\"textarea\" name=\"$field_name\" style=\"width:350; height:150\" rows=\"1\" cols=\"20\">
$field_value
</textarea>



Any ideas on how to make this work in IE twice?