Jump to content

unchangeable String


alim
 Share

Recommended Posts

with help this command i can put a string insted of a selected one :tinyMCE.execCommand('mceInsertRawHTML', false, "blabla");but i can delete this string insinde the Tiny editor with the Del Button ( Keyboard ) ! How can make it undeletable or unchangeable ??? Does anybody have an idea ?

Link to comment
Share on other sites

You could make it private within a custom object, but the custom object can still be deleted (if someone knows its name):

function CustomObject(string){	this.getString = function(){		return string;	};}var myObj = new CustomObject('my private string');alert(myObj.getString());

Link to comment
Share on other sites

He's asking about a user-interface question. You can't stop someone from hitting the delete or backspace key or any other key to overwrite selected text. You can write the text into an element that does not allow editing though, like a div. Or you can check for a keypress and reset to text to whatever it was before they hit the key.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...