This project is archived and is in readonly mode.

#585 open
Adidi

insertAtCursor not working well in IE

Reported by Adidi | July 17th, 2011 @ 02:33 PM | in 1.4.0.2 (closed)

I think it is related to getSelectedRange problematic function:
If you try to execute insertAtCursor to insert any char to a regular textbox the cursor messed up and always puts the char at the beginning of the textbox
This works fine in Firefox & Chrome:
HTML:

   <input id="txt" type="text" />
   <br />
   <input type="button" value="Insert Char" onclick="insertChar();" />

Javascript:

  var current_index = 0;
  var arr = ['a','b','c','d','e','f','g','h','i'];
  function insertChar(){
     var txt = document.id('txt');
     txt.insertAtCursor(arr[current_index++],false);
     if(current_index == arr.length){
        current_index = 0;
     }
  }

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The MooTools Extensions

People watching this ticket

Pages