WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Wierd behaviors with richedit and usebr, Idris, September 28, 2004
     Re:Wierd behaviors with richedit and usebr, Julian Turner, September 29, 2004
         Re:Wierd behaviors with richedit and usebr, Idris, September 29, 2004
             Re:Wierd behaviors with richedit and usebr , mary, October 14, 2004
             Re:Wierd behaviors with richedit and usebr, Julian Turner, September 30, 2004

Subject: Re:Wierd behaviors with richedit and usebr From: Idris Date: September 29, 2004

Thanks Julian. I'm impressed, all of your assumptions were correct! I changed it to findText instead of using moveStart and moveEnd manually and it worked fine. I didn't try skipping the 13's, but that probably would work too. Thanks again! That two character newline combo is a good thing to know...

-Idris

From: Julian Turner
Sent: September 29, 2004
Subject: Re:Wierd behaviors with richedit and usebr

I don't know if this helps (you have given little information) but:-

1.  I assume you are using IE.

2.  I assume that you are using the IE TextRange object.

3.  I assume that rather than using the TextRange.find method (which should work fine), you are searching using the moveStart and moveEnd methods on a range, or using indexOf on the range.text.

4.  I think that newlines are a combination of Code 10 (Carriage Return) and Code (13) Enter.  However the text range skips Code 13.

5.  Thus given the character sequence

13,10,13,10,H,e,l,l,o   indexOf will give a position "4" for the start of Hello.

However if we ignore the 13's

10,10,H,e,l,l,o   indexOf will give a position "4" is the "l"

So I tend to strip out the 13's before using indexOf

From: Idris
Sent: September 28, 2004
Subject: Re:Wierd behaviors with richedit and usebr

I'm using richedit for an editor, and im using the usebr="true" attribute. I noticed that when you put a couple of enters and then put your cursor after the last enter you put and press left a few times, the cursor acts wierd and skips some br's. Why is this?

Another (more important) possibly related question is when I get the textRange in the iframe, the enters mess me up there. For example if I want to find "hello" and bold it it will do it fine, but if i put 2 enters first, it will bold just the llo and two characters after it. So the enters are shifting something around. Is there anything strange about newlines in the textrange that I should know about? Like is the newline really 2 characters or something?

Thanks in advance,
    Idris






Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX