It´s possible to protect some part of a text so users cant delete it?
Exemple:
In the sentence below, i would like that users could not alter or delete the word protected.
"This is some protected text."
Exemple:
In the sentence below, i would like that users could not alter or delete the word protected.
"This is some protected text."
RE: Prevent text deletion
<span contenteditable="false" unselectable="on">some protected text</span>
this works fine, but if the cursor is positioned before the span tag and i hit the delete key, all the tag is deleted. it happens also if the cursor is after the tag a hit backspace
Any tips on how should i treat this, or where in the code i should look at?
Another question came up.
im using a div tag when i hit enter the another <div></div> is inserted on the code. Anyone knows where in the code this is treated?
Re: Prevent text deletion
Re: Prevent text deletion
And a helper function:
The code above tests if the selection contains a ReadOnly element and tests when backspace or Delete is pressed that the preceding or following element is not ReadOnly..
Re: Prevent text deletion
Re: Prevent text deletion
but where to put that code and how to use it?
Re: Prevent text deletion
Hi
Hi
I am working on the same issue for the CKEditor and not able to find the code working.
I have used the code given by @Helmo. Not able to fix in chrome and fireforx browser.
Plz help me out.
Thanks in advance
Rohan