"onchange" not working after submitting the form in codemirror

Hi, I have the form which is having textarea editor :

<textarea id="editor" name="field1"><?php if(isset($_POST['field1'])){echo htmlentities ($_POST['field1']);}?></textarea>
<script>
  var cm = CodeMirror.fromTextArea(document.getElementById('editor'),{ mode:"text/x-java",lineNumbers: true });
  cm.on("change",function(){
	   document.getElementById('demo11').innerHTML="Some action/message..."; }	

I am submitting the form by dropdown menu:

<select class="tabb" name="launguage" id="launguage" onchange='this.form.submit()' >

Before submitting the form, whatever I am writing/pasting the content in textarea, my "onchange" function is working and I could see my corresponding message.

After submitting the form, for my retrieved content in the textarea through php, I could not see the "onchange" function working. Please help me.