esthera
07-28-2004, 12:06 PM
I am using htmlarea from interactive tools.
I have edited the code but I am running into problems --
What the below code does is wraps <font class=xxx> before the text.
The problem is the code below is not closing the font tag after the text so I end up having html like the following
<FONT class="articledate"> xxxxx
<BR><FONT class="ecstyle"> xxxx
<BR><FONT
class="pagetitle"> dfdfdfdfd</FONT></FONT></FONT>
I need it to close the font before it opens the new font.
Any ideas? Please help.
Here is the relavant code:
else if (cmdID == 'FontStyle' && val) {
if(val!="remove"){
var rng = editdoc.selection.createRange();
if (rng.text.length > 0)
{editor_insertHTML(objname, '<FONT class="' + val + '">' + rng.text + '</FONT>');}
else
{editor_insertHTML(objname, '<FONT class="' + val + '"> </FONT>');}
button_obj.selectedIndex =0;
}
else{
var rng = editdoc.selection.createRange();
fontArray = getFont(rng.parentElement());
fontArray.outerHTML = fontArray.innerHTML;
}
}
I have edited the code but I am running into problems --
What the below code does is wraps <font class=xxx> before the text.
The problem is the code below is not closing the font tag after the text so I end up having html like the following
<FONT class="articledate"> xxxxx
<BR><FONT class="ecstyle"> xxxx
<BR><FONT
class="pagetitle"> dfdfdfdfd</FONT></FONT></FONT>
I need it to close the font before it opens the new font.
Any ideas? Please help.
Here is the relavant code:
else if (cmdID == 'FontStyle' && val) {
if(val!="remove"){
var rng = editdoc.selection.createRange();
if (rng.text.length > 0)
{editor_insertHTML(objname, '<FONT class="' + val + '">' + rng.text + '</FONT>');}
else
{editor_insertHTML(objname, '<FONT class="' + val + '"> </FONT>');}
button_obj.selectedIndex =0;
}
else{
var rng = editdoc.selection.createRange();
fontArray = getFont(rng.parentElement());
fontArray.outerHTML = fontArray.innerHTML;
}
}