Re: Urgent: need this property in FireFox

  •  08-16-2007, 12:08 PM

    Re: Urgent: need this property in FireFox

    Throughout all the literature on the internet, selectionStart and selectionEnd are standard properties used by Mozilla browsers. Those properties provide a reference position that allows us to read where the caret is. We can do this with FTB and other editors, but not with CE for some unknown reason. CE doesn't appear to support these properties.
     
    We need to get the start and end positions (not the content inbetween) of selected ranges for several reasons.
     
    For example, we are using CE as a word processor/text editor. Periodically, the user clicks the [Save] button which causes a postback that reads the editor's content and saves it to a temp file. It may or may not pop up a save window.
     
    After the postback, CE refreshes the content, but redisplays the content from the top instead of from the last scroll position. CE doesn't remember where the content was scrolled to. Also, CE doesn't place the caret back to where it was (we can't use Editor.Focus=true because CE steals the focus from postback-created pop ups and therefore pushes the CE window over top of the pop up).
     
    We got a trick from one of the fellows on this forum to save and reset the scroll so that the content scrolls to the position it was before the save postback.
     
    However, CE does not replace the caret so we need to use javascript to place the caret where it was. To do that, we first have to read the caret position before the postback then set the caret position after the postback
     
    We also need to do similar things transparently using web service callbacks because we are developing a collaboration model.
     
     
    The above reference deals with getting the caret pos in IE (which we can do OK). As it says there: "It’s easy enough in Mozilla: element.selectionStart and element.selectionEnd do the trick. "
     
    Our problem is determining what is the equivalent of element in CE.
     
    Can you help?
     
     
     
View Complete Thread