Unable to save data and trigger Onchange event while using code mirror.
Application Type
Traditional Web


I am using Codemirror library to support SQL editor in our web app. I am using the below javascript in the web block of the screen.

window.onload = function() {
  var mime = 'text/x-sql';
  window.editor = CodeMirror.fromTextArea(document.getElementById('"+sqlInput.Id+"'), {
    mode: mime,
    indentWithTabs: true,
    smartIndent: true,
    lineNumbers: true,
    matchBrackets : true,
    showHint: true,
    lint: true,
    autofocus: true,
    hint: CodeMirror.hint.sql,
    extraKeys: {'Ctrl-Space': 'autocomplete'       
    hintOptions: {tables: {

I am facing two issues with it.

1. The editor is working fine but when I save data with ajax submit data is not getting saved.  After I remove this javascript and save it, it works.

2. I am validating SQL syntax by calling the action in the Onchange property of "sqlInput" and displaying errors on the screen. The same thing is happening with this functionality as well if I have Codemirror Javascript the Onchnage event is not getting triggered. 

Not sure what's going on. Thanks

Hi Nannu,

post your oml, so that it might be more clear to find what's going wrong!!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.