PDA

View Full Version : Override a Font Tag?


gorilla1
04-24-2003, 02:54 PM
I have an editor set up and admins can input content to web site. However, I want a consistent font on the pages. So I disabled font face and size on the editor, and I stick a css style on the section of content that is input. But if they copy paste text to the input area, then font size etc makes it to the web page via font tags within the input. Is there a way that I can override those font tags so they have no effect? I can't think of any such way - is there one? Or will I have to resort to editing the input?

G

Roy Sinclair
04-24-2003, 02:57 PM
Edit the input, otherwise your users will abuse the system more and more as time goes on.

oracleguy
04-24-2003, 04:03 PM
you could use regular expressions to look for such tags and remove them when you process your form.

Frank
04-24-2003, 04:32 PM
You could disable there ablity to paste in to the form.
It shouldn't be to hard to find a script that turns off the Ctrl key.

They would have to type out the text themselves. Anything thats to long for them to type, they could give to you to input. Which might be easier then editing it all yourself.

Frank
04-24-2003, 04:34 PM
You could disable there ablity to paste in to the form.
It shouldn't be to have to find a script that turns off the Ctrl key.

They would have to type out the text themselves, anything thats to long for them to type. They could give to you to input. Which might be easier then editing it all yourself.

gorilla1
04-25-2003, 04:08 PM
Thanks for some good ideas. The people who are inputting are trusted and responsible folks, so I would rather not be overly restrictive. I got them to agree to keep the font face consistent and I edited out font sizes on the output size (using asp). I will adjust later if this does not suffice.

G

cg9com
04-25-2003, 08:21 PM
Just a thought, external CSS can override formatting.

brothercake
04-25-2003, 09:28 PM
I had this problem on an intranet - what I did was write a JS parser to strip out the font tags retrospectively; something like this:

window.onload = function()
{
var docHTML = document.body.innerHTML;
docHTML = docHTML.replace(/<[\/]?font[^<]*>/ig,'');
document.body.innerHTML = docHTML;
}