Has anyone used the richtextbox control? I've got a weird problem, when i copy and paste text from Word i strip out most of the stuff ( i want to leave bits and parts in so i dont remove formatting) :
The alert in the last line tells me everyhting = ok. However when i look into the page after pasting it says everywhere "font size=+0" .... so ... after the past event has taken place.
My question : what causes the "size=+0" to be added and how can i prevent it?
--------------------------------------
deleau@gmail.com
Code:
var newHtml = rng_RTB0.htmlText;
newHtml = newHtml.replace(/<script[^>]*>[\w|\t|\r|\W]*<\/script>/gi,'');
newHtml = newHtml.replace(/<object.*?<\/object>/gi,'');
newHtml = newHtml.replace(/<applet.*?<\/applet>/gi,'');
newHtml = newHtml.replace(/<table[^>]*./gi,'<table border=1>');
newHtml = newHtml.replace(/<p[^>]*./gi,'<p>');
newHtml = newHtml.replace(/<span[^>]*./gi,'<span>');
newHtml = newHtml.replace(/<tr[^>]*./gi,'<tr>');
newHtml = newHtml.replace(/<td[^>]*./gi,'<td>');
newHtml = newHtml.replace(/<font[^>]*./gi,'<font>');
newHtml = newHtml.replace(/<ol[^>]*./gi,'<ol>');
newHtml = newHtml.replace(/<li[^>]*./gi,'<li>');
newHtml = newHtml.replace(/<o:[^>]*./gi,'');
newHtml = newHtml.replace(/<v:[^>]*./gi,'');
newHtml = newHtml.replace(/<\x3fxml[^>]*./gi,''); newHtml = newHtml.replace(/<i[^>]*./gi,'<i>');
rng_RTB0.pasteHTML(newHtml);
alert(newHtml);
The alert in the last line tells me everyhting = ok. However when i look into the page after pasting it says everywhere "font size=+0" .... so ... after the past event has taken place.
My question : what causes the "size=+0" to be added and how can i prevent it?
--------------------------------------
deleau@gmail.com