I want to save all CodeMirrors generated by PHP itself onBlur. Here is what I am talking about:
while ($db_field = mysql_fetch_assoc($result)) {
...
var editor = CodeMirror.fromTextArea(document.getElementById("id'.$db_field['id'].'"), {
lineNumbers: true,
matchBrackets: true,
mode: "application/x-httpd-php",
onBlur: id'.$db_field['id'].'.save()
});
...
}
But it don´t work … FireBug says: “id1 is not defined” … how to do it?
I found bug in my code:
This works like a charm