I am modifying a third party application and within that application, I have this code:
<?php if (!$this->allowEditor) { ?>
$('#ticket_message').val(data.text);
<?php } else { ?>
jInsertEditorText(data.text, 'ticket_message');
<?php } ?>
On the page that I need the modification, it is running the if
statement. And what it currently does is replacing the content of the textarea #ticket_message
but is there also a way it inserts it into the textarea without overwriting existing content.
It would be even better if it inserts it at the last location where the user stopped typing so at the caret.
For instance > TEXTAREA:
Lorem ipsum dolar sit met.
INSERT IT HERE BECAUSE THIS IS THE LAST PLACE THE TEXT CURSOR(caret) WAS SET
Lorem ipsum dolar sit met.