Print Page | Close Window

style=background-color being applied...

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=3122
Printed Date: 01 April 2026 at 10:52am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: style=background-color being applied...
Posted By: Sliv
Subject: style=background-color being applied...
Date Posted: 29 May 2003 at 2:54pm

Hello

I am experiencing an odd problem.  Occasionally, if I'm posting using IE wysiwyg, the saved post message will have the following added to the font tag:

style="BACKGROUND-COLOR: #000000

I have combed through the asp code of the various files and includes and haven't found where this is being created.  I'm wondering if this has something to do with the execcommand function.

The background color of the textbox strIETextBoxColour (skin_file) is set to #000000.  Perhaps the wysiwyg is somehow picking this up from the textbox body tag and applying it to the font tag?  Even more odd, though, is that it only happens sometimes.

I've fooled around with the wysiwyg buttons and functions in an attempt to recreate the problem, but I can't recreate it on demand.

Any ideas as to why this is happening?




Replies:
Posted By: fernan82
Date Posted: 29 May 2003 at 3:10pm

Thank you for posting that! I tought i was the only one having this problem, here's a solution to it: http://forums.webwiz.net/forum_posts.asp?TID=3044&PN=3 - http://forums.webwiz.net/forum_posts.asp?TID=3044&PN=3

unfortunatedly since most users don't seem to be having this problem it will not be fixed on any release



-------------
FeRnAN
http://www.danasoft.com/">


Posted By: Sliv
Date Posted: 29 May 2003 at 3:35pm

Thanks very much.  It doesn't seem to relate to odd/even posts for me.

I'm trying the simpler "remove text=#000000" idea first, to see if it solves the problem.  I've done a half dozen test replies to one topic and the problem hasn't resurfaced yet.  If this doesn't solve it, I'll put in the code you suggested.  I'll let you know how it turns out.

Thanks again.



Posted By: fernan82
Date Posted: 29 May 2003 at 7:00pm

actually what i used on my site was something like this:

strMessage = Replace(strMessage, "style=""BACKGROUND-COLOR: #000000""", "", 1, -1, 1)

as my WYSIWYG background color is black too, that code i posted is just an example of how to make it work on any forum with any background color, i didn't even tested that code...



-------------
FeRnAN
http://www.danasoft.com/">


Posted By: Sliv
Date Posted: 30 May 2003 at 1:32pm

I'll give your code a shot, fernan.  After monitoring the posts for a day, it looks like removing the text part of the body tag didn't resolve the issue.  Thanks.

 



Posted By: fernan82
Date Posted: 30 May 2003 at 2:16pm
the easiest way to find out if your code is working or not is to find one of the posts that came up with the background color and hit the edit button on the post and then hit update post, it should reformat the post and fix it if your code is right...

-------------
FeRnAN
http://www.danasoft.com/">


Posted By: Sliv
Date Posted: 31 May 2003 at 7:48am

Your code works, with a couple corrections:

After BACKGROUND-COLOR:  there is no quotes; the quotes come after the color, so remove the "".

On one line you refer to lngStartPos as lngLinkStartPos that will give an undefined variable error.

For myself, I have a base text css style that affects all unformatted text (body tag redefine) so by using your code, <FONT style="BACKGROUND-COLOR: #000000"> was being replaced and left with <FONT >.  This caused the affected test to "ignore" my css rule.  So, I had to adjust the code by adding "<FONT " to the front of the search string and upping the Mid counter from 33 to 40.

This may cause havoc if you allow users to edit their own font attributes as I'm not sure how the font tags are combined...

Personally, I remove font choice, size and colour as it's quite ridiculous what some people consider attractive for reading.  I prefer to have my css dictate the formatting.  They still have bold, italic, and all the buttons, the rest is handled by css.



Posted By: Sliv
Date Posted: 31 May 2003 at 7:52am
Oh and, don't forget to put that code in both the wysiwyg and regular formatpost functions.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net