3 Answers, 1 is accepted
0
Yasser
Top achievements
Rank 1
answered on 17 Jun 2009, 12:03 PM
Hi all, i found the way, its working fine in IE but in firefox focus is calling again and again,,
any ideas??
var OnTelerikClientLoad = function(editor, args) {
var element = document.all ? editor.get_document().body : editor.get_document();
$telerik.addExternalHandler(element, "focus", function(e) {
alert("focus!");
});
$telerik.addExternalHandler(element, "blur", function(e) {
alert("blur!");
});
}0
Yasser
Top achievements
Rank 1
answered on 18 Jun 2009, 09:38 AM
hi all , the above function is not working correctly in Firefox, its working fine in IE but not in Firefox
what is the exact way to call a JavaScript function when focus is set to Rad Editor ??
what is the exact way to call a JavaScript function when focus is set to Rad Editor ??
0
GT
Top achievements
Rank 1
answered on 22 Jun 2009, 06:00 AM
Hi,
I was able to run your code as expected in Firefox by simply replacing the alert() function with a reference to a div element and applying to it a new border when the focus and blur events are executed, e.g.
I hope this helps.
I was able to run your code as expected in Firefox by simply replacing the alert() function with a reference to a div element and applying to it a new border when the focus and blur events are executed, e.g.
| <div id="myDIV" style="border: 1px solid red;">test</div> |
| <telerik:radeditor runat="server" OnClientLoad="OnTelerikClientLoad" ID="RadEditor1"></telerik:radeditor> |
| <script type="text/javascript"> |
| var OnTelerikClientLoad = function(editor, args) |
| { |
| var element = document.all ? editor.get_document().body : editor.get_document(); |
| $telerik.addExternalHandler(element, "focus", function(e) { |
| $get("myDIV").style.border = "2px solid green"; |
| }); |
| $telerik.addExternalHandler(element, "blur", function(e) { |
| $get("myDIV").style.border = "3px solid blue"; |
| }); |
| } |
| </script> |
I hope this helps.