Hello all,
Im tring to increment my editor if i call for two editors on one page. below is my function. So if it calls the function twice in one page it auto-increments the $num variable. With this code it just displays oEdit2 on both eidtors when the page is called.
Thanks in advance.
function do_textarea_row($title, $name, $value='')
{
// ==============================
// WYSIWYG Editor
// ==============================
echo <<<EOF
<TR>
<TD CLASS="formlabel" COLSPAN="2">
<B>$title</B><BR />
EOF;
echo "<textarea id=\"$name\" name=\"$name\" rows=4 cols=30>";
if(isset($value)) echo encodeHTML($value);
$num = 1;
++$num;
echo <<<EOF
</textarea>
<script>
var oEdit$num = new InnovaEditor("oEdit$num");
oEdit$num.REPLACE("$name");
</script>
</TD>
</TR>
EOF;
}
RESOLVED thanks to search button lol just changed it to
static $num = 1;
$num++;