Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - style=background-color being applied...
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

style=background-color being applied...

 Post Reply Post Reply
Author
Sliv View Drop Down
Newbie
Newbie
Avatar

Joined: 29 May 2003
Location: Canada
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sliv Quote  Post ReplyReply Direct Link To This Post Topic: style=background-color being applied...
    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?

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post 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

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

FeRnAN
Back to Top
Sliv View Drop Down
Newbie
Newbie
Avatar

Joined: 29 May 2003
Location: Canada
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sliv Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Sliv View Drop Down
Newbie
Newbie
Avatar

Joined: 29 May 2003
Location: Canada
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sliv Quote  Post ReplyReply Direct Link To This Post 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.

 

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post 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...

Edited by fernan82
FeRnAN
Back to Top
Sliv View Drop Down
Newbie
Newbie
Avatar

Joined: 29 May 2003
Location: Canada
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sliv Quote  Post ReplyReply Direct Link To This Post 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.



Edited by Sliv
Back to Top
Sliv View Drop Down
Newbie
Newbie
Avatar

Joined: 29 May 2003
Location: Canada
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sliv Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 2003 at 7:52am
Oh and, don't forget to put that code in both the wysiwyg and regular formatpost functions.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.