Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created April 22, 2022 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/c64bec09aca02996dde36c98379b81f0 to your computer and use it in GitHub Desktop.
Save bjoerntx/c64bec09aca02996dde36c98379b81f0 to your computer and use it in GitHub Desktop.
function attachClickEvent(field) {
// remove active listeners
TXTextControl.removeEventListener("textFieldClicked", selectField);
// handle only editable form text fields
if (field.textField.type === "TEXTFORMFIELD" && field.textField.editable === true) {
// store current field for later comparison
_currentField = field;
// set the input value
document.querySelector("#cmFieldName").value = field.textField.name;
drawContextMenu();
TXTextControl.addEventListener("textFieldClicked", selectField);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment