Using the JavaScript api TX Text Control .NET Server for ASP.NET
JavaScript API
JavaScript API
, a document can be manipulated in the HTML5-based rich text editor. Version X15 already contains a solid number of classes and methods to fulfil common tasks. We are working on a huge update for this interface for version X16 where you will see many new classes and methods available. The ultimate goal is to provide a complete API comparable to the API that is useable with TXTextControl.ServerTextControl class TX Text Control .NET for Windows Forms
TXTextControl Namespace
ServerTextControl Class
The ServerTextControl class implements a component that provide high-level text processing features for server-based applications.
.

We received many requests last week regarding text fields and how to remove them programmatically - specifically using the Backspace and Delete keys. By default, fields are not editable and deletable. The following code snippet shows how to remove the field at the current input position when the user is pressing the Backspace or Delete key. This code also works, if these keys are pressed at the beginning or the end of a field in order to remove it.

window.onload = function () {
// attach keyDown event
document.addEventListener("keydown", keyDownHandler, false);
};
function keyDownHandler(e) {
var keyCode = e.keyCode;
// set fields to editable
TXTextControl.textFieldsEditable = true;
// if DELETE or BACKSPACE
if (keyCode == 8 || keyCode == 46) {
TXTextControl.getTextFields(function (e) { // get field at input positions
if (typeof e !== 'undefined' && e.length > 0) { // if array is defined
// remove the field at the input position
TXTextControl.removeTextField(e[0], false);
}
}, true);
}
}
view raw test.js hosted with ❤ by GitHub

Happy coding!