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

[Solved] How to Prevent Accidental Click on Backspace Button

4 Answers 153 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ismet
Top achievements
Rank 1
Ismet asked on 25 Jan 2010, 07:45 PM
I write so fast at editor and sometimes i click on backspace on editor area or focused on other areas of page. So how can i prevent accidental clicks that causing a lose of entry? :)

4 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 26 Jan 2010, 11:44 AM
Hi Ismet,

I am not sure that this problem is directly related to the editor control, but if the accidental click of the backspace results in a data lose from the editor's content area, as a solution I would suggest you to attach a simple javascript confirm to the onbeforeunload event to prevent the data lose, e.g.:
window.onbeforeunload = function() {
    if(!confirm("Are you sure you want to leave the page?")) return false;
}


I hope this information helps.

Sincerely yours,
Dobromir
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Ismet
Top achievements
Rank 1
answered on 27 Jan 2010, 06:59 AM
That was what i looking for, however i am not sure where to place this code.
I'm using DotNetNuke, where should i place this code? Would you please direct me?
0
Lini
Telerik team
answered on 27 Jan 2010, 07:27 AM
Hello Ismet,

If you want the code to be present in each page where there is a RadEditor control, then add the code to the ~/controls/texteditor.ascx file in your DNN site.

Greetings,
Lini
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Ismet
Top achievements
Rank 1
answered on 29 Jan 2010, 05:05 PM
Great, attached js and it works great :)
Thanks for your assistance Lini.
Tags
Editor
Asked by
Ismet
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Ismet
Top achievements
Rank 1
Lini
Telerik team
Share this question
or