Urgent: need this property in FireFox

Last post 09-05-2007, 9:39 AM by fredd. 6 replies.
Sort Posts: Previous Next
  •  08-15-2007, 6:36 PM 32520

    Urgent: need this property in FireFox

    How do I get selectionStart in FireFox?
     
    I've tried:
     
    var editselection=editor1.GetSelection();
     
    editselection.selectionStart << doesn't work
     
    also:
     
    var editdoc=editor1.GetDocument();
     
    editdoc.body.selectionStart << doesn't work
     
    also:
     
    var editwin = editor1.GetWindow();
     
    editwin.selectionStart; << doesn't work
     
    What is the correct method. This is urgent, please...
  •  08-15-2007, 7:01 PM 32521 in reply to 32520

    Re: Urgent: need this property in FireFox

    fredd,
     
    Can you explain what you are trying to achieve?
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  08-16-2007, 12:08 PM 32539 in reply to 32521

    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?
     
     
     
  •  08-16-2007, 7:05 PM 32551 in reply to 32539

    Re: Urgent: need this property in FireFox

    HI Adam,
     
    After much digging, we've found out how to get the caret position. However, we can't set the position.
     
    For example, assume the following:
     
    this is a sentence and this stuff
     
    Assume we want to place the caret at position 10, like this:
     
    this is a |sentence and this stuff
     
    (Pretend the | is the cursor)
     
    How do we do it?
     
    This is very important to us, Adam. Please see what you can do to get a solution for us.
     
    Thanks
  •  08-30-2007, 7:32 AM 33088 in reply to 32551

    Re: Urgent: need this property in FireFox

    Any luck w/ this?
     
    Having same problem.
     
    Killing me.
     
    Michael
  •  09-03-2007, 11:07 AM 33187 in reply to 33088

    Re: Urgent: need this property in FireFox

    Adam: Anything on this, yet?
     
    FredD
  •  09-05-2007, 9:39 AM 33257 in reply to 33187

    Re: Urgent: need this property in FireFox

    Adam, are you going to provide some help on this property>
View as RSS news feed in XML