Is anyone out there really good with Internet Explorer scripting in the
document.selection / textRange area?
I'm trying to add a nice little formatting bar to the form at the bottom of
each page on the piclist.com site. This is to help people who don't
understand HTML to add things like bold, italic, etc... To the text they are
posting.
The goal is to make it such that it fails gracefully and yet takes advantage
of browser features as available. As it stands, a non-JavaScript browser
will never see the formatting buttons. A minimal browser will only be able
to have the formatting codes appended to the end of the text. The ideal
thing, and what I expect from IE, would be that when the user hits the
button for bold, if there is text selected, it puts around the text
and if there is no text selected, it just inserts the and then:
/moves the cursor to the center so you can start typing bold text/. E.g. if
the | is the cursor, when there is no text selected, it should end up like
this: |.
I hope that makes sense. Now, I have all that working in IE /except/ for the
part about the position of the cursor. One is supposed to be able to move
the thing with the .move("character",distance) method to a textRange object
where distance is the negative or positive number of characters to move. And
I have seen it work before, but for some.... amazingly frustrating...
reason, it will not work here.
If you want to see the current state of it, just go to piclist.com and
scroll to near the bottom and look at the little form. The source for that
part is reproduced below. Any suggestions very appreciated.
---
James Newton: PICList webmaster/Admin
mailto:jamesnewton@piclist.com 1-619-652-0593 phone
http://www.piclist.com/member/JMN-EFP-786
PIC/PICList FAQ: http://www.piclist.com
--
http://www.piclist.com PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist