Last active
October 24, 2018 21:53
-
-
Save bjoerntx/d9399ee98c60b40a7ed06f8572fac5ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment