This is a migrated thread and some comments may be shown as answers.

[Solved] .pasteHtml replacing all text in IE8

2 Answers 80 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Robert Saddler
Top achievements
Rank 1
Robert Saddler asked on 23 Feb 2010, 09:48 AM
I've gone through the thread in Asp.net editor but can't find a solution. I added createRestorePoint to my javascript function so that any pasting would occur on the last cursor location and not at the start of the radeditor and while it works fine on Mozilla, in IE8 it the pasteHTML replaces the entire content every time. My code is as below.

<input type='button' id='cmdDynEmailField' value=' >> ' onclick='SetValueInBody()' unselectable='on' /> 


function SetValueInBody() {
  var _dllGetDynamicFieldKey = $find('" + _dllGetDynamicFieldKey.ClientID + "'); 
  var _txtBody = $find('" + _txtRadEditor.ClientID + "'); 
  var _restorePoint  = _txtBody.createRestorePoint(); 
  _restorePoint.Select(); 
  _txtBody.pasteHtml(_dllGetDynamicFieldKey.get_value()); 

Please ignore the syntax of the two $find statements, the javascript is built up in a string on the server side

2 Answers, 1 is accepted

Sort by
0
Robert Saddler
Top achievements
Rank 1
answered on 23 Feb 2010, 01:49 PM
Any input at all on this telerik admin? When I remove the createRestorePoint/Select() lines pasteHtml works again in IE8 but putting the value at the start of the radeditor rather than where the cursor had been.
0
Rumen
Telerik team
answered on 24 Feb 2010, 05:00 PM
Hi Robert,

The createRestorePoint and Select methods are obsolete in RadEditor for ASP.NET AJAX. My suggestion is to remove it from your code, because the unselectable="on" attribute should be enough to fix the problem.

If the problem still persist then try the getRange method.


All the best,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
Robert Saddler
Top achievements
Rank 1
Answers by
Robert Saddler
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or